Initial AudioParam bindings

This commit is contained in:
Fernando Jiménez Moreno 2018-06-29 09:11:11 +02:00
parent 885addfaae
commit 7380f69f77
8 changed files with 187 additions and 55 deletions

View file

@ -6,18 +6,24 @@
* https://webaudio.github.io/web-audio-api/#dom-audioparam
*/
enum AutomationRate {
"a-rate",
"k-rate"
};
[Exposed=Window]
interface AudioParam {
attribute float value;
attribute AutomationRate automationRate;
readonly attribute float defaultValue;
readonly attribute float minValue;
readonly attribute float maxValue;
// AudioParam setValueAtTime(float value, double startTime);
// AudioParam linearRampToValueAtTime(float value, double endTime);
// AudioParam exponentialRampToValueAtTime(float value, double endTime);
// AudioParam setTargetAtTime(float target,
// double startTime,
// float timeConstant);
AudioParam setValueAtTime(float value, double startTime);
AudioParam linearRampToValueAtTime(float value, double endTime);
AudioParam exponentialRampToValueAtTime(float value, double endTime);
AudioParam setTargetAtTime(float target,
double startTime,
float timeConstant);
// AudioParam setValueCurveAtTime(sequence<float> values,
// double startTime,
// double duration);

View file

@ -24,11 +24,11 @@ dictionary OscillatorOptions : AudioNodeOptions {
[Exposed=Window,
Constructor (BaseAudioContext context, optional OscillatorOptions options)]
interface OscillatorNode : AudioScheduledSourceNode {
/* [SetterThrows]
attribute OscillatorType type;
// [SetterThrows]
// attribute OscillatorType type;
readonly attribute AudioParam frequency;
readonly attribute AudioParam detune;
// readonly attribute AudioParam detune;
void setPeriodicWave (PeriodicWave periodicWave);*/
// void setPeriodicWave (PeriodicWave periodicWave);
};