本文整理汇总了C++中AudioNodeStream::SetDoubleParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioNodeStream::SetDoubleParameter方法的具体用法?C++ AudioNodeStream::SetDoubleParameter怎么用?C++ AudioNodeStream::SetDoubleParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioNodeStream
的用法示例。
在下文中一共展示了AudioNodeStream::SetDoubleParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AudioNode
DelayNode::DelayNode(AudioContext* aContext, double aMaxDelay)
: AudioNode(aContext)
, mDelay(new AudioParam(this, SendDelayToStream, 0.0f, 0.0f, float(aMaxDelay)))
{
DelayNodeEngine* engine = new DelayNodeEngine(aContext->Destination());
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
engine->SetSourceStream(static_cast<AudioNodeStream*> (mStream.get()));
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
ns->SetDoubleParameter(DelayNodeEngine::MAX_DELAY, aMaxDelay);
}
示例2: AudioNode
DelayNode::DelayNode(AudioContext* aContext, double aMaxDelay)
: AudioNode(aContext,
2,
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mMediaStreamGraphUpdateIndexAtLastInputConnection(0)
, mDelay(new AudioParam(this, SendDelayToStream, 0.0f))
{
DelayNodeEngine* engine = new DelayNodeEngine(this, aContext->Destination());
mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM);
engine->SetSourceStream(static_cast<AudioNodeStream*> (mStream.get()));
AudioNodeStream* ns = static_cast<AudioNodeStream*>(mStream.get());
ns->SetDoubleParameter(DelayNodeEngine::MAX_DELAY, aMaxDelay);
}
示例3: Start
void
AudioBufferSourceNode::Start(double aWhen, double aOffset,
const Optional<double>& aDuration, ErrorResult& aRv)
{
if (!WebAudioUtils::IsTimeValid(aWhen) ||
(aDuration.WasPassed() && !WebAudioUtils::IsTimeValid(aDuration.Value()))) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
return;
}
if (mStartCalled) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
mStartCalled = true;
AudioNodeStream* ns = mStream;
if (!ns) {
// Nothing to play, or we're already dead for some reason
return;
}
// Remember our arguments so that we can use them when we get a new buffer.
mOffset = aOffset;
mDuration = aDuration.WasPassed() ? aDuration.Value()
: std::numeric_limits<double>::min();
WEB_AUDIO_API_LOG("%f: %s %u Start(%f, %g, %g)", Context()->CurrentTime(),
NodeType(), Id(), aWhen, aOffset, mDuration);
// We can't send these parameters without a buffer because we don't know the
// buffer's sample rate or length.
if (mBuffer) {
SendOffsetAndDurationParametersToStream(ns);
}
// Don't set parameter unnecessarily
if (aWhen > 0.0) {
ns->SetDoubleParameter(START, aWhen);
}
}