Recently I've been working on an application which will involve reading & writing WAV audio files. I've read that the WAV file specification
specifies that WAV files are little-endian. Does anyone know if audio data needs to be treated differently on big-endian computers? I imagine you'd need to convert the audio samples to big-endian before doing any audio processing, and then convert the audio samples back to little-endian before saving to disk, but I'm not sure if audio processing software just leaves the samples as-is. Audio processing often involves mathematics though, so
I imagine that not honoring the computer's endianness could be bad..
WAV file format is a Microsoft/IBM creation for Windows/PCs, so they do stor multi-byte integers in little endian. What big endian platforms would you be modifying WAV files on?
Recently I've been working on an application which will involve reading & writing WAV audio files. I've read that the WAV file specification.WAV files are designed by Microsoft for Windows, so naturally it'd be little endian format. I'd imagine if playing on a big-endian machine, you'd want to convert them to big-endian first before playing or editing them, then convert them back to little-endian. I may be wrong as it's been a long time since I've messed around with digital audio processing. Last time I did was DOS in turbo pascal, using a Sound Blaster 16 if that gives you an idea.
specifies that WAV files are little-endian. Does anyone know if audio data needs to be treated differently on big-endian computers? I imagine you'd need to convert the audio samples to big-endian before doing any audio processing, and then convert the audio samples back to little-endian before saving to disk, but I'm not sure if audio processing software just leaves the samples as-is. Audio processing often involves mathematics though, so
I imagine that not honoring the computer's endianness could be bad..
.WAV files are designed by Microsoft for Windows, so naturally it'd be littl endian format. I'd imagine if playing on a big-endian machine, you'd want t convert them to big-endian first before playing or editing them, then conver them back to little-endian. I may be wrong as it's been a long time since I
Recently I've been working on an application which will involve reading& writing WAV audio files. I've read that the WAV file specification specifies that WAV files are little-endian. Does anyone know if audio data needs to be treated differently on big-endian computers? I imagine you'd need to convert the audio samples to big-endian before doing any audio processing, and then convert the audio samples back to little-endian before saving to disk, but I'm
not sure if audio processing software just leaves the samples as-is. Audio processing often involves mathematics though, so I imagine that not honoring the computer's endianness could be bad..
What about SDL?
Depending on what you are doing, you may want to use a class library that already handling the WAV files to a native audio stream for whatever conversions you are wanting to make...
you'd need to handle the WAV data by
reading in each character/byte/integer etc at a time and converting... this rather cumbersome and odds are someone has already done it.
Sysop: | Eric Oulashin |
---|---|
Location: | Beaverton, Oregon, USA |
Users: | 105 |
Nodes: | 16 (0 / 16) |
Uptime: | 02:06:35 |
Calls: | 5,904 |
Calls today: | 4 |
Files: | 8,496 |
D/L today: |
77 files (33,206K bytes) |
Messages: | 343,107 |