Converting WAV files to *.txt format

Header of the output file tells you the amount of samples per second.
Other lines are in the following format:
<sample_no> <level>
e.g.
1 1422
2 1899
3 267
4 964
5 244
6 -2223
...