Difference between revisions of ".wav class"
From Jeskola Buzz Wiki
(Created page with 'Design proposition of a lean and mean .wav file handler class == General design goals == * Should not be bloated and support obscure unused features like ADPCM and such. Just PCM…')
Revision as of 10:00, 29 June 2010
Design proposition of a lean and mean .wav file handler class
General design goals
- Should not be bloated and support obscure unused features like ADPCM and such. Just PCM.
- Should be object oriented (C++), so that handling several files is a breeze
- Should handle both mono and stereo
- Should handle up to 192 KHz samplerate
- Should handle the following input formats: 8-bit int, 16-bit int, 24-bit int, 32-bit float
- Should handle the following output formats: 16-bit int, 24-bit int (optionally 8-bit int and 32-bit float)
- Optionally should handle IFF AIFF files (as they are 95% identical to .wav it should be fairly simple)
- Remember to use unsigned int for file sizes. No reason to limit ourselves at 2GB when 4GB is the actual limit.
- Should it support files larger than 4 GB? How does this even work?
- What should happen to unknown chunks such as markers, weird beat info. It would be super nice to be able to maintain these, but this would take memory.
- Opens the file and reads meta data (samplerate etc.) into the class, so that various parameters can be known up front.
- ReadData(chunksize, convert_to_float)
- Streams in a block of data from the file
- Save(output file bitdepth)
Internal data field
- Length (in samples)
- Bits per sample