Results 1 to 5 of 5
  1. #1
    hariru01 is offline Member
    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Default Soundbank is not loading

    Hi,

    I am beginner on netbeans. I trying to load soundbank on netbeans. I have the jfugue.jar file in the classpath. This is the code snippet I am using to load the soundbank file.

    MidiChannel[] mc = null;
    try {
    Synthesizer synth = MidiSystem.getSynthesizer();
    synth.open();

    synth.loadAllInstruments(MidiSystem.getSoundbank(n ew File("C:\\Program Files\\Java\\jre7\\lib\\audio\\soundbank-deluxe.gm")));

    mc = synth.getChannels();

    } catch (Exception e) {e.printStackTrace();}

    And it is giving me this error
    javax.sound.midi.InvalidMidiDataException: cannot get soundbank from stream

    Do I have to do anything else when trying to load this file?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,371
    Blog Entries
    7
    Rep Power
    20

    Default Re: Soundbank is not loading

    I think the Exception is slightly inaccurate (I checked the sources for Java 1.6): no matter what you supply (an InputStream, a URL or a File), the Exception always states that it can't load the soundbank from a supplied 'stream'. I wonder what happens if you try to load the default bank, i.e. "soundbank.gm".

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: Soundbank is not loading

    Quote Originally Posted by hariru01 View Post
    This is the code snippet I am using to load the soundbank file.
    Are you sure you have a file soundbank-deluxe.gm in the path in your code? or is this a search/copy/paste/try blindly approach? Last I checked, the JRE doesn't come with a soundbank (the JDK 6 does, but I don't see one in my JDK 7 installation).

    Incidentally, the soundbanks supplied are buggy. This old thread may help (note: I haven't tested the 'fix' that was supplied later).
    https://forums.oracle.com/forums/thr...89625&#5389625

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    hariru01 is offline Member
    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Default Re: Soundbank is not loading

    Thanks for responding.

    If I try the default soundbank it load only one instrument.
    I tried to add soundbank-deluxe.gm inthe JRE hoping to load but it still gives me that error.

Similar Threads

  1. Help with loading
    By waker3210 in forum Advanced Java
    Replies: 9
    Last Post: 08-06-2012, 03:28 PM
  2. Loading Servlet
    By Mindhunter74 in forum Java Servlet
    Replies: 1
    Last Post: 10-05-2009, 10:11 PM
  3. loading JInternalFrames
    By vishakha in forum AWT / Swing
    Replies: 5
    Last Post: 07-23-2008, 03:58 PM
  4. loading a new Jframe
    By Ebylord in forum New To Java
    Replies: 0
    Last Post: 07-22-2008, 08:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •