Write_word( f, 4, 2 ) // data block size (size of two integer samples, one for each channel, in bytes) Write_word( f, 176400, 4 ) // (Sample Rate * BitsPerSample * Channels) / 8 Write_word( f, 44100, 4 ) // samples per second (Hz) Write_word( f, 2, 2 ) // two channels (stereo file) Write_word( f, 1, 2 ) // PCM - integer samples Write_word( f, 16, 4 ) // no extension data Ofstream f( "example.wav", ios::binary ) į << "RIFF-WAVEfmt " // (chunk size to be filled in later) Std::ostream& write_word( std::ostream& outs, Word value, unsigned size = sizeof( Word ) ) #include #include #include using namespace std
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |