Closed
Bug 854336
Opened 12 years ago
Closed 12 years ago
Implement the playbackRate property of AudioBufferSourceNode
Categories
(Core :: Web Audio, defect)
Core
Web Audio
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: padenot, Assigned: padenot)
References
Details
Attachments
(1 file)
(deleted),
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
This is needed for the doppler effect for the AudioPannerNode, since the doppler shift is applied by changing the |playbackRate| of the AudioBufferSourceNode.
Comment 1•12 years ago
|
||
Note that the doppler shift is an additional rate multiplier and its value should not be reflected through the playbackRate attribute to web content, but this plan makes sense.
Blocks: webaudio
Assignee | ||
Comment 2•12 years ago
|
||
This implement the |playbackRate| member of the AudioBufferSourceNode.
I'm not sure about the |ConvertAudioParamToTicks| part, but it seems correct
when I try, for example, to do a
|sourceNode.playbackRate.linearRampToValueAtTime(2, 37.0)|.
Attachment #733770 -
Flags: review?(ehsan)
Comment 3•12 years ago
|
||
Comment on attachment 733770 [details] [diff] [review]
Implement the playbackRate property of AudioBufferSourceNode. r=
Review of attachment 733770 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the below fixed.
::: content/media/webaudio/AudioBufferSourceNode.cpp
@@ +299,5 @@
> }
>
> + // WebKit treats the playbackRate as a k-rate parameter in their code,
> + // despite the spec saying that it should be an a-rate parameter. We treat
> + // it as k-rate.
Please include a URL to the spec bug here.
@@ +487,5 @@
> +AudioBufferSourceNode::SendPlaybackRateToStream(AudioNode* aNode)
> +{
> + AudioBufferSourceNode* This = static_cast<AudioBufferSourceNode*>(aNode);
> + AudioNodeStream* ns = static_cast<AudioNodeStream*>(This->mStream.get());
> + ns->SetTimelineParameter(AudioBufferSourceNodeEngine::PLAYBACKRATE, *This->mPlaybackRate);
You can use AudioNode::SendTimelineParameterToStream like this:
AudioBufferSourceNode* This = static_cast<AudioBufferSourceNode*>(aNode);
SendTimelineParameterToStream(This, AudioBufferSourceNodeEngine::PLAYBACKRATE, *This->mPlaybackRate);
::: content/media/webaudio/AudioBufferSourceNode.h
@@ +56,5 @@
> + }
> + void SetPlaybackRate(NonNull<AudioParam> aPlaybackRate)
> + {
> + mPlaybackRate = aPlaybackRate.get();
> + }
Drop the setter please.
::: content/media/webaudio/WebAudioUtils.cpp
@@ +28,5 @@
> + GraphTime graphTime = This->mSourceStream->StreamTimeToGraphTime(streamTime);
> + destinationStreamTime = This->mDestinationStream->GraphTimeToStreamTime(graphTime);
> + } else {
> + destinationStreamTime = This->mDestinationStream->GetCurrentPosition();
> + }
You should rebase this on top of my patch in bug 857790.
@@ +46,5 @@
> }
>
> +void
> +WebAudioUtils::ConvertAudioParamToTicks(AudioParamTimeline& aParam,
> + AudioNodeStream* aDest)
I'm not sure why you need this override. Just pass nullptr to the source argument in the other override and get rid of this one please.
::: dom/webidl/AudioBufferSourceNode.webidl
@@ +25,3 @@
> attribute AudioBuffer? buffer;
>
> + attribute AudioParam playbackRate;
Argh, this should be a read-only attribute. I fixed the spec.
Attachment #733770 -
Flags: review?(ehsan) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Comment 5•12 years ago
|
||
Backed out because of mochitest-1 crashes: https://hg.mozilla.org/integration/mozilla-inbound/rev/8cf0185087b2
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Comment 8•11 years ago
|
||
Mass moving Web Audio bugs to the Web Audio component. Filter on duckityduck.
Component: Video/Audio → Web Audio
You need to log in
before you can comment on or make changes to this bug.
Description
•