mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-12 18:50:08 +00:00
Bug 816828 - Implement AudioContext.sampleRate; r=bzbarsky
This commit is contained in:
parent
40ac47a449
commit
cf3c707293
@ -31,6 +31,7 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AudioContext, Release)
|
||||
AudioContext::AudioContext(nsIDOMWindow* aWindow)
|
||||
: mWindow(aWindow)
|
||||
, mDestination(new AudioDestinationNode(this))
|
||||
, mSampleRate(44100) // hard-code for now
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
@ -62,6 +62,11 @@ public:
|
||||
return mDestination;
|
||||
}
|
||||
|
||||
float SampleRate() const
|
||||
{
|
||||
return mSampleRate;
|
||||
}
|
||||
|
||||
AudioListener* Listener();
|
||||
|
||||
already_AddRefed<AudioBufferSourceNode> CreateBufferSource();
|
||||
@ -90,6 +95,7 @@ private:
|
||||
nsCOMPtr<nsIDOMWindow> mWindow;
|
||||
nsRefPtr<AudioDestinationNode> mDestination;
|
||||
nsRefPtr<AudioListener> mListener;
|
||||
float mSampleRate;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ addLoadEvent(function() {
|
||||
SpecialPowers.setBoolPref("media.webaudio.enabled", true);
|
||||
var ac = new mozAudioContext();
|
||||
ok(ac, "Create a mozAudioContext object");
|
||||
is(ac.sampleRate, 44100, "Correct sample rate");
|
||||
SpecialPowers.clearUserPref("media.webaudio.enabled");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
@ -14,6 +14,7 @@
|
||||
interface mozAudioContext {
|
||||
|
||||
readonly attribute AudioDestinationNode destination;
|
||||
readonly attribute float sampleRate;
|
||||
readonly attribute AudioListener listener;
|
||||
|
||||
[Creator, Throws]
|
||||
|
Loading…
x
Reference in New Issue
Block a user