I have a short mp3 file from which I need to get a raw audio track in the form of an array for the subsequent Fourier transform.
I tried to use Jlayer to convert mp3 to wav, to decrypt wav into an array
For this, I use the following code:

public class Main { public static void main(String[] args) { try{ String sourceFile = "nts.mp3"; String targetFile = "out/nts.wav"; AudioInputStream mp3Stream = AudioSystem.getAudioInputStream(new File(sourceFile)); AudioFormat sourceFormat = mp3Stream.getFormat(); AudioFormat convertFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, sourceFormat.getSampleRate(), 16, sourceFormat.getChannels(), sourceFormat.getChannels() * 2, sourceFormat.getSampleRate(), false); AudioInputStream converted = AudioSystem.getAudioInputStream(convertFormat, mp3Stream); AudioSystem.write(converted, AudioFileFormat.Type.WAVE, new File(targetFile)); }catch (Exception e){ e.printStackTrace(); } } } 

However, in converted, I get the stream completely clogged with zeros.
Tritonus_share-0.3.6.jar, mp3spi1.9.5.jar, jl1.0.1.jar are connected to the project
What could be the error?

    0