MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

AudioBuffer.copyFromChannel()

这篇翻译不完整。请帮忙从英语翻译这篇文章

AudioBuffer接口的copyFromChannel方法将样本从AudioBuffer的指定通道复制到目标数组中

语法

myArrayBuffer.copyFromChannel(destination,channelNumber,startInChannel);

参数

destination
将通道数据复制到的Float32Array
channelNumber
当前AudioBuffer的通道号,用于复制通道数据。键入channelNumber大于或等于AudioBuffer.numberOfChannels,将会抛出INDEX_SIZE_ERR 的错误
startInChannel 可选
用于复制数据的可选偏移量。假如startInChannel比AudioBuffer.length大,将会抛出INDEX_SIZE_ERR 的错误

例子

var myArrayBuffer = audioCtx.createBuffer(2, frameCount, audioCtx.sampleRate);  
var anotherArray = new Float32Array;
myArrayBuffer.copyFromChannel(anotherArray,1,0);

规范

Specification Status Comment
Web Audio API
copyFromChannel
Working Draft  

浏览器兼容性

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 14.0 webkit (Yes) 27 (27) 未实现 15 webkit
22 (unprefixed)
未实现
Unprefixed 43.0 (Yes) ? ? ? 未实现
Feature Android Android Webview Edge Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support 未实现 ? (Yes) 27.0 (27) 1.2 未实现 未实现 未实现 28.0 webkit
Unprefixed 未实现 未实现 (Yes) ? ? ? ? 未实现 43.0

See also

文档标签和贡献者

 此页面的贡献者: SHALLYKL
 最后编辑者: SHALLYKL,