Chromium Code Reviews| Index: Source/modules/webaudio/ScriptProcessorNode.cpp |
| diff --git a/Source/modules/webaudio/ScriptProcessorNode.cpp b/Source/modules/webaudio/ScriptProcessorNode.cpp |
| index 79c446c96f432d7f6cfed6d71feae697b7e15993..3aba767a1e7b96176e71f17b8425d6852b63eddf 100644 |
| --- a/Source/modules/webaudio/ScriptProcessorNode.cpp |
| +++ b/Source/modules/webaudio/ScriptProcessorNode.cpp |
| @@ -265,8 +265,12 @@ void ScriptProcessorNode::fireProcessEvent() |
| // Let the audio thread know we've gotten to the point where it's OK for it to make another request. |
| m_isRequestOutstanding = false; |
| + // Calculate a playbackTime with the buffersize which needs to be processed each time onaudioprocess is called. |
| + // The outputBuffer being passed to JS will be played after exhuasting previous outputBuffer by double-buffering. |
| + double playbackTime = (context()->currentSampleFrame() + m_bufferSize) / context()->sampleRate(); |
|
Raymond Toy
2014/03/28 18:14:14
Cast context()->sampleRate() to double because it'
KhNo
2014/03/29 00:24:46
I missed it. Thank you.
|
| + |
| // Call the JavaScript event handler which will do the audio processing. |
| - dispatchEvent(AudioProcessingEvent::create(inputBuffer, outputBuffer)); |
| + dispatchEvent(AudioProcessingEvent::create(inputBuffer, outputBuffer, playbackTime)); |
| } |
| } |