Skip to content

Commit 8cf3b8f

Browse files
committed
fix: constraint on destination channel count mode
1 parent f9a25ab commit 8cf3b8f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/node/destination.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ impl AudioNode for AudioDestinationNode {
6161
self.channel_config.set_count(v);
6262
}
6363
fn set_channel_count_mode(&self, _v: ChannelCountMode) {
64-
panic!("InvalidStateError: AudioDestinationNode has channel count mode constraints");
64+
// [spec] If the AudioDestinationNode is the destination node of an
65+
// OfflineAudioContext, then the channel count mode cannot be changed.
66+
// An InvalidStateError exception MUST be thrown for any attempt to change the value.
67+
if self.registration.context().offline() {
68+
panic!("InvalidStateError: AudioDestinationNode has channel count mode constraints");
69+
}
6570
}
6671
}
6772

0 commit comments

Comments
 (0)