title: Conflicting Jar Methods
body: <p>I have been trying to make my first GUI music player in Java. So far I have been able to play MP3 with Javasound and MP3SPI. Now, I want to support .m4a songs and from what I have researched the best library to do this is JAAD. I downloaded it, added it to my project and it worked perfectly when I tried to play a .m4a song. The problem happens when I try to play an .mp3 after adding the JAAD library. My code for playing songs is: </p>
  
  <pre><code>File file = new File(pathToSong);
  AudioInputStream audioStream= AudioSystem.getAudioInputStream(file); // Obtains an audio input stream of the song
      AudioFormat baseFormat = audioStream.getFormat();    //Obtains the audio format of the song in the audio input stream.
      decodedFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, //The type of encoding for the audio stream
                      baseFormat.getSampleRate(), //Sample rate of the audio stream
                      16, //Number of bits in each sample of a sound that has this format.
                      baseFormat.getChannels(),   //Number of audio channels in this audio stream
                      baseFormat.getChannels() * 2,   //Number of bytes in each frame of the audiostream
                      baseFormat.getSampleRate(), //Number of frames played or recorded per second, for the sound in the audio stream
                      false); //Data stored in little-endian order
  
  decodedAudioStream = AudioSystem.getAudioInputStream(decodedFormat, audioStream); //Obtains an audio input stream of the indicated encoding by converting the provided audio input stream.
  
  playSong(); //Play the song
  </code></pre>
  
  <p>(playSong() simply read the stream and writes the bytes to the SourceDataLine)</p>
  
  <p>The error I get when I try to play an .mp3 after adding the JAAD library is the following:</p>
  
  <pre><code>java.io.IOException: Resetting to invalid mark
      at java.io.BufferedInputStream.reset(BufferedInputStream.java:416)
      at net.sourceforge.jaad.spi.javasound.AACAudioFileReader.getAudioInputStream(AACAudioFileReader.java:118)
      at net.sourceforge.jaad.spi.javasound.AACAudioFileReader.getAudioInputStream(AACAudioFileReader.java:143)
      at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1162)
      at Song.run(Song.java:38)
  </code></pre>
  
  <p>From my understanding, it seems that the getAudioInputStream from Javasound and from JAAD are conflicting. How can I resolve this conflict?</p>