mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 873553 - Part 10: Allow creating OfflineAudioContexts with arbitrary sampling rates; r=roc
--HG-- extra : rebase_source : 99758cbe05b83d34734e4df11f30ebbbd12811df
This commit is contained in:
parent
c74b3d338f
commit
6d703a83b0
@ -108,8 +108,8 @@ AudioContext::Constructor(const GlobalObject& aGlobal,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (aSampleRate != IdealAudioRate()) {
|
||||
// TODO: Add support for running OfflineAudioContext at other sampling rates
|
||||
if (aSampleRate <= 0.0f) {
|
||||
// The DOM binding protects us against infinity and NaN
|
||||
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
SpecialPowers.setBoolPref("media.webaudio.enabled", true);
|
||||
var ctx = new OfflineAudioContext(2, 100, (new AudioContext()).sampleRate);
|
||||
var ctx = new OfflineAudioContext(2, 100, 22050);
|
||||
ok(ctx instanceof EventTarget, "OfflineAudioContexts must be EventTargets");
|
||||
|
||||
var buf = ctx.createBuffer(2, 100, ctx.sampleRate);
|
||||
@ -23,6 +23,13 @@ addLoadEvent(function() {
|
||||
}
|
||||
}
|
||||
|
||||
expectException(function() {
|
||||
new OfflineAudioContext(2, 100, 0);
|
||||
}, DOMException.SYNTAX_ERR);
|
||||
expectException(function() {
|
||||
new OfflineAudioContext(2, 100, -1);
|
||||
}, DOMException.SYNTAX_ERR);
|
||||
|
||||
var src = ctx.createBufferSource();
|
||||
src.buffer = buf;
|
||||
src.start(0);
|
||||
|
Loading…
Reference in New Issue
Block a user