ECE-1021

HOMEWORK #9

(Last Mod: 27 November 2010 21:38:42 )

ECE-1021 Home


WAV File Reader

Write a program that opens the wave file "sine1000.wav".

If should print the header information to the screen and dump the data to an ASCII text file.

The data in this file contains 16 bits per sample. Your program is only required to work for files of this data size, but your program should check to see if the WAV file being read is compatible with the limitations of your program and print an appropriate error message before exiting if it is not.

Your text file output should be formatted as one sample per line with two values for each sample. The first value is the time (in seconds) and the second value is the sample amplitude. The first time sample should be considered as being at time zero.

If you import this data into a spreadsheet program, such as Excel, and plot the data you should find that it is a 1000 hertz sine wave.