chrome36?からWeb Audioの仕様が変わったようなのでとりあえず動くコードのメモ
http://updates.html5rocks.com/tag/webaudio
audio.coffee
# https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Porting_webkitAudioContext_code_to_standards_based_AudioContext#Removal_of_the_synchronous_AudioContext.createBuffer_method
# webkit以外も動くように
window.AudioContext = window.AudioContext || window.webkitAudioContext
context = new AudioContext()
src = context.createBufferSource()
gain = context.createGain() # createGainNode()から変更
analyserNode = context.createAnalyser()
analyserNode.connect(context.destination)
src.connect(gain)
gain.gain.value = 0.85
gain.connect analyserNode
_analyzedData = new Uint8Array(analyserNode.frequencyBinCount)
play = ->
context.decodeAudioData request.response, (onSuccess = (decodedBuffer) ->
# bufferはcallback内に変更
src.buffer = decodedBuffer
src.start(0) #noteOn()から変更
), onFailure = -> console?.info "Decoding the audio buffer failed"
# 再生用
request = new XMLHttpRequest()
url = "some/audiodata.mp3"
request.open "GET", url, true
request.responseType = "arraybuffer"
request.onload = -> play()
request.send()