## Program to create a WAV file from ASCII file of numbers

### C++ source code by Don Cross

### [back to Reading/Writing WAV files]

Here is a sample program for reading a text file of numbers and creating a WAV file based on it.

The command line syntax for the program is:

>     MAKEWAV inFile outWave samplingRate bitsPerSample numChannels

Following the WAV spec, when you have 8-bit audio, the data in the input file are in the range 0 to 255 for backward compatibility. When you have 16-bit audio, the values should be in the range -32768 to 32767.

`data.txt` [643K] - This is a sample input file for the MAKEWAV program. To generate the WAV file, use the following command:

>     makewav data.txt data.wav 44100 16 2