{
setNodeType(NodeTypeAudioBufferSource);
- m_gain = AudioGain::create(context, "gain", 1.0, 0.0, 1.0);
+ m_gain = AudioParam::create(context, "gain", 1.0, 0.0, 1.0);
m_playbackRate = AudioParam::create(context, "playbackRate", 1.0, 0.0, MaxRate);
-
+
// Default to mono. A call to setBuffer() will set the number of output channels to that of the buffer.
addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
return output(0)->numberOfChannels();
}
+#if ENABLE(TIZEN_WEB_AUDIO)
+void AudioBufferSourceNode::startGrain(double when, double grainOffset, ExceptionCode& ec)
+{
+ // Duration of 0 has special value, meaning calculate based on the entire buffer's duration.
+ startGrain(when, grainOffset, 0, ec);
+}
+#else
void AudioBufferSourceNode::startGrain(double when, double grainOffset)
{
// Duration of 0 has special value, meaning calculate based on the entire buffer's duration.
startGrain(when, grainOffset, 0);
}
+#endif
+#if ENABLE(TIZEN_WEB_AUDIO)
+void AudioBufferSourceNode::startGrain(double when, double grainOffset, double grainDuration, ExceptionCode& ec)
+#else
void AudioBufferSourceNode::startGrain(double when, double grainOffset, double grainDuration)
+#endif
{
ASSERT(isMainThread());
+#if ENABLE(TIZEN_WEB_AUDIO)
+ if (m_playbackState != UNSCHEDULED_STATE) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+#else
if (m_playbackState != UNSCHEDULED_STATE)
return;
+#endif
if (!buffer())
return;
m_playbackState = SCHEDULED_STATE;
}
+#if ENABLE(TIZEN_WEB_AUDIO)
+#if ENABLE(LEGACY_WEB_AUDIO)
+void AudioBufferSourceNode::noteGrainOn(double when, double grainOffset, double grainDuration, ExceptionCode& ec)
+{
+ startGrain(when, grainOffset, grainDuration, ec);
+}
+#endif
+#else
#if ENABLE(LEGACY_WEB_AUDIO)
void AudioBufferSourceNode::noteGrainOn(double when, double grainOffset, double grainDuration)
{
startGrain(when, grainOffset, grainDuration);
}
#endif
+#endif
double AudioBufferSourceNode::totalPitchRate()
{