I wanted to do exactly the same in node.js. There is a module called wav which sort of does it. However I faced several problems.
1. The Reader() method reads the file stream and converts into chunks of Buffer. This is very good while building web apps as you can send chunks of data separately and combine it later. However, I was just writing a script that'd run offline, So I had to put all the buffers to an array and then use the concat method of Buffer.
2. The wav module doesn't do much processing and just throws the raw binary information at us. So, we have to take care of
- Combining hex data to get amplitudes - One frame can be represented using several blocks of 8-bit hex. The number of blocks per frame is got using blockAlign parameter in the format.
- Endianness - Data may or may not be in little endian format. So, while reading the blocks of hex data, we have to take care of this.
- Handling negative amplitudes - Frames spanning several blocks when negative can be little challenging to handle as they are just stored as their two's complement.
- Separating channels - The raw binary contains data of all the channels together. Fortunately, they are mentioned one after the other. Using channels parameter in the format, channels can be separated easily.