|
|
|
|
|
|
|
|
context.decodeAudioData(file, function(buffer) { |
|
|
context.decodeAudioData(file, function(buffer) { |
|
|
var monoData = []; |
|
|
var monoData = []; |
|
|
if(buffer.numberOfChannels == 1) { |
|
|
if(buffer.numberOfChannels == 1) { |
|
|
monoData = buffer.getChannelData(1); |
|
|
|
|
|
|
|
|
monoData = buffer.getChannelData(0); |
|
|
} else if(buffer.numberOfChannels == 2) { |
|
|
} else if(buffer.numberOfChannels == 2) { |
|
|
var leftData = buffer.getChannelData(0); |
|
|
var leftData = buffer.getChannelData(0); |
|
|
var rightData = buffer.getChannelData(1); |
|
|
var rightData = buffer.getChannelData(1); |