Hi,
I'm working with java, trying to use the AudioFormat Class. I have the following piece of code:
AudioFormat Baseformat = input.getFormat();
AudioFormat Finalformat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED,
Baseformat.getSampleRate(),
16, Baseformat.getChannels(), Baseformat.getChannels()*2,
Baseformat.getSampleRate(),false);
AudioInputStream stream1 = AudioSystem.getAudioInputStream(
Finalformat, input);
numBytesRead = stream1.read(audioBytes)
Where audioBytes is an array where the data bytes are stored. I need to know how those bytes are organized. In Finalformat I'm specifying PCM enconding, stereo and 16 bits per sample. That means that for a given time instant there are 2 samples (1 for each channel) and each sample has 2 bytes. How are these bytes arranged?
If audioBytes = AABBCCDD, which bytes belong to each channel and what is the byte order of each sample? An example of the explanation I'm looking for is: AA BB is the left channel; AA is the low order byte.
Thanks to everyone who reads this.