@@ -55,11 +55,24 @@ impl AudioNode for AudioDestinationNode {
55
55
}
56
56
57
57
fn set_channel_count ( & self , v : usize ) {
58
+ // <https://webaudio.github.io/web-audio-api/#AudioDestinationNode>
59
+ // numberOfChannels is the number of channels specified when constructing the
60
+ // OfflineAudioContext. This value may not be changed; a NotSupportedError exception MUST
61
+ // be thrown if channelCount is changed to a different value.
62
+ //
63
+ // <https://webaudio.github.io/web-audio-api/#dom-audionode-channelcount>
64
+ // The channel count cannot be changed. An InvalidStateError exception MUST be thrown for
65
+ // any attempt to change the value.
66
+ //
67
+ // TODO spec issue: NotSupportedError or InvalidStateError?
58
68
assert ! (
59
69
!self . registration. context( ) . offline( ) || v == self . max_channel_count( ) ,
60
70
"NotSupportedError - not allowed to change OfflineAudioContext destination channel count"
61
71
) ;
62
72
73
+ // <https://webaudio.github.io/web-audio-api/#dom-audionode-channelcount>
74
+ // The channel count MUST be between 1 and maxChannelCount. An IndexSizeError exception
75
+ // MUST be thrown for any attempt to set the count outside this range.
63
76
assert ! (
64
77
v <= self . max_channel_count( ) ,
65
78
"IndexSizeError - channel count cannot be greater than maxChannelCount ({})" ,
@@ -70,7 +83,11 @@ impl AudioNode for AudioDestinationNode {
70
83
}
71
84
72
85
fn set_channel_count_mode ( & self , v : ChannelCountMode ) {
73
- // [spec] If the AudioDestinationNode is the destination node of an
86
+ // <https://webaudio.github.io/web-audio-api/#AudioDestinationNode>
87
+ // For an OfflineAudioContext, the defaults are [..] channelCountMode: "explicit"
88
+ //
89
+ // <https://webaudio.github.io/web-audio-api/#dom-audionode-channelcountmode>
90
+ // If the AudioDestinationNode is the destination node of an
74
91
// OfflineAudioContext, then the channel count mode cannot be changed.
75
92
// An InvalidStateError exception MUST be thrown for any attempt to change the value.
76
93
assert ! (
0 commit comments