mirror of
https://github.com/SPAWNRYS-ban/FUCK-CustomDiscs.git
synced 2026-01-29 10:19:36 +05:00
Implement converting from FLAC to PCM
This commit is contained in:
@@ -121,6 +121,12 @@ public class PlayerManager {
|
||||
AudioInputStream convertedInputStream = new MpegFormatConversionProvider().getAudioInputStream(decodedFormat, inputStream);
|
||||
finalInputStream = AudioSystem.getAudioInputStream(audioFormat, convertedInputStream);
|
||||
|
||||
} else if (getFileExtension(file.toFile().toString()).equals("flac")) {
|
||||
AudioInputStream inputStream = new FlacAudioFileReader().getAudioInputStream(file.toFile());
|
||||
AudioFormat baseFormat = inputStream.getFormat();
|
||||
AudioFormat decodedFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, baseFormat.getSampleRate(), 16, baseFormat.getChannels(), baseFormat.getChannels() * 2, baseFormat.getFrameRate(), false);
|
||||
AudioInputStream convertedInputStream = new Flac2PcmAudioInputStream(inputStream, decodedFormat, inputStream.getFrameLength());
|
||||
finalInputStream = AudioSystem.getAudioInputStream(audioFormat, convertedInputStream);
|
||||
}
|
||||
|
||||
assert finalInputStream != null;
|
||||
|
||||
Reference in New Issue
Block a user