Welcome to Stratos!
struct wavh{ char riff[4]; uint32 size; char wave[4]; char fmt[4]; uint32 num; uint16 format; uint16 channels; uint32 freq; uint32 abps; uint16 blockalign; uint16 bitdepth; char data[4]; uint32 datasize; } ;wavh wave = { { 'R', 'I', 'F', 'F' }, sizeof(wave) + N_SAMPLES*2, { 'W', 'A', 'V', 'E' }, { 'f', 'm', 't', ' ' }, 0x10, 1, 1, 44100, 88200, 2, 16, { 'd', 'a', 't', 'a' }, N_SAMPLES*2};int main(){int16 *wave_data = new int16[sizeof(wavh)+samples]; *(struct wavh*)wave_data = wave;//rellenas los datos...FILE *file = fopen("sample.wav", "wb");fwrite(wave_data, wave.size, 1, file);fclose(file);...}