I am using SoundJS from CreateJS and I was wondering, is there anyway I can get the raw (hex) data of an audio playing? I am adding a custom header into the audio file for lip syncing characters but I don't know how to get the audio's raw Hex Data.
I've tried looking in _playbackResource but nothing.
var instance = playSound(whichTalkie);
console.log(instance._playbackResource);
I need the raw audio data. How do I solve the problem?
I assume you mean that you want the raw AudioBuffer that is loaded.
There is no official way to do this in SoundJS 1.0 (we are exposing a lot more in 2.0, which you can see in the in-progress branch in Git).
However, you can access all the buffers that are loaded using:
Additionally, there is even more info, including the raw Array Buffer, buried in the load items that SoundJS stores.
Unfortunately there is no clean way to get the buffer from a sound instance.
You listen to the "fileload" event, you can get the src directly from the event:
Or get the src from a
play()call:I hope that helps!