я получаю следующее:
Код: Выделить всё
[mp3float @ 000001b4fa125d80] Could not update timestamps for skipped samples.
[mp3float @ 000001b4fa125d80] Could not update timestamps for discarded samples.
Код: Выделить всё
public AudioInputStream audio;
File file;
Код: Выделить всё
public AudioInputStream DecodeFLAC_OGG_MP3() throws IOException, UnsupportedAudioFileException {
FFAudioFileReader audioFileReader = new FFAudioFileReader();
AudioInputStream audio = audioFileReader.getAudioInputStream(this.file);
AudioFormat baseFormat = audio.getFormat();
AudioFormat decodedFormat = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
baseFormat.getSampleRate(),
16,
baseFormat.getChannels(),
baseFormat.getChannels() * 2,
baseFormat.getSampleRate(),
false
);
AudioInputStream decodedAudio = AudioSystem.getAudioInputStream(decodedFormat, audio);
// Wrap the AudioInputStream with a BufferedInputStream to enable mark/reset
BufferedInputStream bufferedInputStream = new BufferedInputStream(decodedAudio);
return new AudioInputStream(bufferedInputStream, decodedFormat, decodedAudio.getFrameLength());
}
Код: Выделить всё
audio.mark(0);
audio.reset();
Подробнее здесь: https://stackoverflow.com/questions/790 ... -sound-sam