Search Results

Search found 2 results on 1 pages for 'northernen'.

Page 1/1 | 1 

  • Issues regarding playing audio files in a JME midlet.

    - by Northernen
    I am making a midlet which is to be used to play out local audio files. It is obviously not working. I am getting a null reference on the "is" variable, in the code snippet shown below. 1. try{ 2. System.out.println("path: " + this.getClass()); 3. InputStream is = this.getClass().getResourceAsStream("res/01Track.wav"); 4. p1=Manager.createPlayer(is, "audio"); 5. p1.realize(); 6. p1.prefetch(); 7. p1.start(); 8. } 9. catch(Exception e){ 10. System.out.println(e.getMessage()); 11. } I assume there is something wrong with the "this.getClass().getResourceAsStream("res/01Track.wav")" bit, but I can not for the life of me figure out why, and I have tried referring to the file in 20 different ways. If I printline "this.getClass()" it gives me "path: class Mp3spiller". The absolute path to "01Track.wav" is "E:\Mine dokumenter\Dokumenter\workspace_mobiljava\Mp3spiller\res\01Track.wav". Am I completely wrong in thinking that I should refer relatively to "E:\Mine dokumenter\Dokumenter\workspace_mobiljava\Mp3spiller"? If anyone could point out what I am doing wrong, I would be grateful. I have basically stolen the code from a tutorial I found online, so I would have thought it would be working.

    Read the article

  • Saving MP3 playlist to file

    - by Northernen
    Hello. I am making my own crude MP3 player, and I now have a JList with which I have populated a number of files in the form of MP3 objects (displayed on frame using DefaultListModel). I would now like to have the oppurtunity to save this JList to a file on disk. How would I go about doing this? I'm very new with programming and Java, so help is greatly appreciated.

    Read the article

1