Closed Bug 938450 Opened 12 years ago Closed 12 years ago

decodeAudioData skips frames when resampling

Categories

(Core :: Web Audio, defect)

25 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(7 files)

Adding MOZ_ASSERT(inSamples == audioData->mFrames); at http://hg.mozilla.org/mozilla-central/annotate/7b014f0f3b03/content/media/webaudio/MediaBufferDecoder.cpp#l365 fails when resampling between 48000 and 44100, which happens during test_mediaDecoding.html
Depends on: 937475
Applies on top of patches in bug 937057. This of course makes test_mediaDecoding.html fail because it is testing that our resampling code doesn't change.
Depends on: 937057
No longer depends on: 937475
With this patch, the 48kHz tests fail comparisons with the expected files when run in a 44.1kHz context and the 44.1kHz tests fail these comparisons when run in a 48kHz context. Before this patch, all tests failed these comparisons when run in a 48kHz context.
Attachment #8340931 - Flags: feedback?(paul)
I want to use compareBuffers in fixing test_mediaDecoding.html.
Attachment #8340932 - Flags: feedback?(ehsan)
While I'm here.
Attachment #8340934 - Flags: feedback?(ehsan)
Some refactoring of test_mediaDecoding.html to make fixing it easier.
Comment on attachment 8340936 [details] [diff] [review] use an OfflineAudioContext to test decodeAudioData at different sample rates Review of attachment 8340936 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/webaudio/test/test_mediaDecoding.html @@ +245,5 @@ > } > > function runTest(test, response, callback) { > var expectCallback = false; > + var cx = new OfflineAudioContext(1, 1, test.sampleRate); I would expect this to work, yes.
Attachment #8340936 - Flags: feedback?(paul) → feedback+
Attachment #8340931 - Flags: feedback?(paul) → feedback+
Attachment #8340928 - Flags: review?(paul) → review+
Comment on attachment 8340934 [details] [diff] [review] reduce the number of offset parameters to compareChannels() Review of attachment 8340934 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/webaudio/test/test_scriptProcessorNode.html @@ +94,5 @@ > is(e.outputBuffer.numberOfChannels, 2, "Correct number of channels for the output buffer"); > is(e.outputBuffer.length, 2048, "Correct length for the output buffer"); > is(e.outputBuffer.sampleRate, context.sampleRate, "Correct sample rate for the output buffer"); > > var firstNonZero = findFirstNonZeroSample(e.inputBuffer); Please add a test to make sure firstNonZero < 2048 for sanity checking.
Attachment #8340934 - Flags: feedback?(ehsan) → feedback+
Attachment #8340932 - Attachment is patch: true
Comment on attachment 8340932 [details] [diff] [review] rename compareBuffers to compareChannels & add compareBuffers Review of attachment 8340932 [details] [diff] [review]: ----------------------------------------------------------------- Nice!
Attachment #8340932 - Flags: feedback?(ehsan) → feedback+
Flags: in-testsuite+ → in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: