I've only just installed Visual Studio 2017 and haven't had much of a play with it yet tbh.
However all I've done is change a little bit in wav.c
Code: Select all
byte header[44] = { 'R', 'I', 'F', 'F', // File description header.
0x0, 0x0, 0x0, 0x0, // Filesize - 8.
'W', 'A', 'V', 'E', // "WAVE" Description header.
'f', 'm', 't', ' ', // "fmt " Description header.
0x10, 0x0, 0x0, 0x0, // Size of WAVE section chunck.
0x1, 0x0, // Wave type format.
0x1, 0x0, // Mono or stereo.
0x22, 0x56, 0x0, 0x0, // Sample rate. 0x40 0xad for 44100Hz, 0x22 0x56 for 22050Hz, 0x40 0x38 for 14400Hz, 0x80 0x25 for 9600Hz
0x22, 0x56, 0x0, 0x0, // Bytes per second. 0x40 0xad for 44100Hz, 0x22 0x56 for 22050Hz, 0x40 0x38 for 14400Hz, 0x80 0x25 for 9600Hz
0x1, 0x0, // Block alignment.
0x8, 0x0, // Bits per sample.
'd', 'a', 't', 'a', // "data" Description header.
0x0, 0x0, 0x0, 0x0 }; // Size of data chunk.
EDIT
Okay managed to compile it now and it works to output at 22050Hz.