Add support for multichannel decoded audio

This commit is contained in:
Fernando Jiménez Moreno 2018-08-30 09:13:57 +02:00
parent 795e7f6002
commit f423ede07f
4 changed files with 113 additions and 21 deletions

View file

@ -144,6 +144,10 @@ impl OfflineAudioContextMethods for OfflineAudioContext {
task!(resolve: move || {
let this = this.root();
let processed_audio = processed_audio.lock().unwrap();
let processed_audio: Vec<_> = processed_audio
.chunks(this.length as usize)
.map(|channel| channel.to_vec())
.collect();
let buffer = AudioBuffer::new(
&this.global().as_window(),
this.channel_count,