I would personally look for a library that does an endian replacement for you. There are assumptions about reliability in each format of audio files for you, and obtaining this right is difficult for all depths / data types supported by wave files:
- 8bit - uint8
- 16bit - int16
- 24bit - int32
- 32bit - int32 as float
- 32bit - float
- 64bit - double
If you want to support most of the common wave file types, you will need endian conversion for all of these data types.
I would look at ByteSwapper , which will give you bytes for most of the types listed above.
Too bad Java does not have authority fields in its IO file classes. The ability to simply open a whos edianness file, large or small, is a much easier solution to this problem.
source share