Title: [89471] trunk/Source/WebCore
- Revision
- 89471
- Author
- [email protected]
- Date
- 2011-06-22 13:17:16 -0700 (Wed, 22 Jun 2011)
Log Message
2011-06-22 Chris Rogers <[email protected]>
Reviewed by Kenneth Russell.
AudioContext noteGrainOn() method should not apply explicit windowing
https://bugs.webkit.org/show_bug.cgi?id=63005
No new tests since audio API is not yet implemented.
* webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::readFromBuffer):
* webaudio/AudioBufferSourceNode.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (89470 => 89471)
--- trunk/Source/WebCore/ChangeLog 2011-06-22 20:15:05 UTC (rev 89470)
+++ trunk/Source/WebCore/ChangeLog 2011-06-22 20:17:16 UTC (rev 89471)
@@ -1,3 +1,16 @@
+2011-06-22 Chris Rogers <[email protected]>
+
+ Reviewed by Kenneth Russell.
+
+ AudioContext noteGrainOn() method should not apply explicit windowing
+ https://bugs.webkit.org/show_bug.cgi?id=63005
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioBufferSourceNode.cpp:
+ (WebCore::AudioBufferSourceNode::readFromBuffer):
+ * webaudio/AudioBufferSourceNode.h:
+
2011-06-22 Kentaro Hara <[email protected]>
Reviewed by Tony Chang.
Modified: trunk/Source/WebCore/webaudio/AudioBufferSourceNode.cpp (89470 => 89471)
--- trunk/Source/WebCore/webaudio/AudioBufferSourceNode.cpp 2011-06-22 20:15:05 UTC (rev 89470)
+++ trunk/Source/WebCore/webaudio/AudioBufferSourceNode.cpp 2011-06-22 20:17:16 UTC (rev 89471)
@@ -323,44 +323,15 @@
if (!isDestinationGood)
return;
- if (m_isGrain)
- readFromBufferWithGrainEnvelope(sourceL, sourceR, destinationL, destinationR, framesToProcess);
- else {
- // Simply copy the data from the source buffer to the destination.
- memcpy(destinationL, sourceL, sizeof(float) * framesToProcess);
- if (numberOfChannels == 2)
- memcpy(destinationR, sourceR, sizeof(float) * framesToProcess);
- }
+ // Simply copy the data from the source buffer to the destination.
+ memcpy(destinationL, sourceL, sizeof(float) * framesToProcess);
+ if (numberOfChannels == 2)
+ memcpy(destinationR, sourceR, sizeof(float) * framesToProcess);
// Advance the buffer's read index.
m_readIndex += framesToProcess;
}
-void AudioBufferSourceNode::readFromBufferWithGrainEnvelope(float* sourceL, float* sourceR, float* destinationL, float* destinationR, size_t framesToProcess)
-{
- ASSERT(sourceL && destinationL);
- if (!sourceL || !destinationL)
- return;
-
- int grainFrameLength = static_cast<int>(m_grainDuration * m_buffer->sampleRate());
- bool isStereo = sourceR && destinationR;
-
- int n = framesToProcess;
- while (n--) {
- // Apply the grain envelope.
- float x = static_cast<float>(m_grainFrameCount) / static_cast<float>(grainFrameLength);
- m_grainFrameCount++;
-
- x = min(1.0f, x);
- float grainEnvelope = sinf(piFloat * x);
-
- *destinationL++ = grainEnvelope * *sourceL++;
-
- if (isStereo)
- *destinationR++ = grainEnvelope * *sourceR++;
- }
-}
-
void AudioBufferSourceNode::reset()
{
m_resampler.reset();
Modified: trunk/Source/WebCore/webaudio/AudioBufferSourceNode.h (89470 => 89471)
--- trunk/Source/WebCore/webaudio/AudioBufferSourceNode.h 2011-06-22 20:15:05 UTC (rev 89470)
+++ trunk/Source/WebCore/webaudio/AudioBufferSourceNode.h 2011-06-22 20:17:16 UTC (rev 89471)
@@ -143,9 +143,6 @@
// A grain envelope will be applied if m_isGrain is set to true.
void readFromBuffer(AudioBus* destinationBus, size_t framesToProcess);
- // readFromBufferWithGrainEnvelope() is a low-level blitter which reads from the AudioBuffer and applies a grain envelope.
- void readFromBufferWithGrainEnvelope(float* sourceL, float* sourceR, float* destinationL, float* destinationR, size_t framesToProcess);
-
// Handles the time when we reach the end of sample data (non-looping) or the noteOff() time has been reached.
void finish();
};
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes