当前位置: 首页>>代码示例>>C++>>正文


C++ AudioNodeStream::SetDoubleParameter方法代码示例

本文整理汇总了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);
}
开发者ID:JSilver99,项目名称:mozilla-central,代码行数:10,代码来源:DelayNode.cpp

示例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);
}
开发者ID:dimag0g,项目名称:Pale-Moon,代码行数:14,代码来源:DelayNode.cpp

示例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);
    }
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:41,代码来源:AudioBufferSourceNode.cpp


注:本文中的AudioNodeStream::SetDoubleParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。