Add "stabilization read" to MP3 seeks in SoundSourceCoreAudio.#565
Conversation
|
Paging @asantoni :) might be useful for libaudiodecoder. |
|
See what Uwe did in sounsource mp3 We seek 29 mp3 frames reverse, which is 1152 * 29 sample per channel. If CoreAudio does not seek revers, you need to seek 33408 stereo frames backward to be bullet prove. |
There was a problem hiding this comment.
This value is applied to any file type isn't it? :-/
There was a problem hiding this comment.
So wee need to find the worst of them. An the other are suffering an unneeded performance penalty.
Or can can we use SoundsourceMp3 here? Equal weapons for all targets, less special cased code to maintain.
There was a problem hiding this comment.
Is it possible to compare the libmad CPU performance with the coreaudio one?
There was a problem hiding this comment.
I'd rather not have to build libmad on mac. We will always have to use SSCoreAudio for M4A/AAC support so this doesn't actually save us any code.
Ah right -- I'll update to use 29 and make it MP3 only. |
SoundSourceProxyTest.seekForward was failing on OSX due to cover-test.mp3 not producing accurate samples on a seek. It seems this is related to the MP3 decoder not being "primed" right after a seek. To compensate for this, we seek backwards 29 MP3 frames (same as in SoundSourceMp3) and read forward. The test passes now but it would be ideal if we had a reliable way to determine the right amount to read on a per-file basis from ExtAudioFile directly (in case other formats need pre-fetching). I'm following up with Apple support for help here.
|
PTAL, updated. |
|
Merging now to fix the master build. |
Add "stabilization read" to MP3 seeks in SoundSourceCoreAudio.
SoundSourceProxyTest.seekForward was failing on OSX due to
cover-test.mp3 not producing accurate samples on a seek. It seems this
is related to the MP3 decoder not being "primed" right after a seek. To
compensate for this, we seek backwards 29 MP3 frames (same as in
SoundSourceMp3) and read forward.
The test passes now but it would be ideal if we had a reliable way to
determine the right amount to read on a per-file basis from ExtAudioFile
directly (in case other formats need pre-fetching). I'm following up
with Apple support for help here.