Boa tarde.
Estou fazendo um player em Java sound, encontrei na web a o metodo RUN , nele existe o trecho abaixo que diz que tem que converter o arquivo para PCM_signed antes de tocar o som wm wav. Poderiam me explicar o porquê???
//Conversao de ALAW e ULAW pra PCM_SIGNED antes de tocar o arquivo
AudioFormat format = stream.getFormat();
if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) {
format = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
format.getSampleRate(),
format.getSampleSizeInBits()*2,
format.getChannels(),
format.getFrameSize()*2,
format.getFrameRate(),
true);
stream = AudioSystem.getAudioInputStream(format, stream);
}
Estou usando o pacote javax.sound.sampled.*