WAV File IO - psambit9791/jdsp GitHub Wiki
Reading a WAV File
Variable inputFilename contains the path of the file to be read as a string.
Wav objRead1 = new Wav();
objRead1.readWav(inputFilename);
Hashtable<String, Long> propsOut = objRead1.getProperties(); // Gets the WAV file properties
double[][] signal = objRead1.getData("int"); // Can be 'int', 'long' 'double'
Writing to a WAV File
Variable outputFilename contains the path of the file to be written to as a string.
Variable signal is a 2D array which contains channels and channel content
Wav objWrite = new Wav();
int samplingRate = 44100;
objWrite.putData(signal, samplingRate, "int", outputFileName); // Can be "int", "long" or "double' depending on the content of signal