--- title: AudioBuffer.copyFromChannel() slug: Web/API/AudioBuffer/copyFromChannel translation_of: Web/API/AudioBuffer/copyFromChannel ---
{{ APIRef("Web Audio API") }}
{{ domxref("AudioBuffer") }}接口的copyFromChannel方法将样本从AudioBuffer的指定通道复制到目标数组中
myArrayBuffer.copyFromChannel(destination,channelNumber,startInChannel);
INDEX_SIZE_ERR
的错误INDEX_SIZE_ERR
的错误var myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate); var anotherArray = new Float32Array; myArrayBuffer.copyFromChannel(anotherArray,1,0);
Specification | Status | Comment |
---|---|---|
{{SpecName('Web Audio API', '#widl-AudioBuffer-copyFromChannel-void-Float32Array-destination-long-channelNumber-unsigned-long-startInChannel', 'copyFromChannel')}} | {{Spec2('Web Audio API')}} |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | {{CompatChrome(14.0)}} {{property_prefix("webkit")}} | {{CompatVersionUnknown}} | {{CompatGeckoDesktop(27)}} | {{CompatNo}} | 15 {{property_prefix("webkit")}} 22 (unprefixed) |
{{CompatNo}} |
Unprefixed | {{CompatChrome(43.0)}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} |
Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile(27)}} | 1.2 | {{CompatNo}} | {{CompatNo}} | {{CompatNo}} | {{CompatChrome(28.0)}} {{property_prefix("webkit")}} |
Unprefixed | {{CompatNo}} | {{CompatNo}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatChrome(43.0)}} |