Firstoff, read and parse the wav file to understand it's sound sample patterns. 8bit and 16bit sounds are stored differently. I had some great help from BrowserUK in this
node. Although it is a Win32 node, the storage of wav file data is the same across the board.