Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AudioSystem can't find any Mixers though they exist

2671310May 12 2014 — edited May 13 2014

I just moved my code over to a different computer, and code to play sounds that worked doesn't because AudioSystem says there are no Mixers, which are necessary to output any sound. The computer has the usual mixers and they work outside Java, so why doesn't it find them?  I've searched the web and can't find anyone else who has had this problem. I've been doing this for 15 years with similar code! The computer is a 32-bit Dell running Win7, like my previous computer.

Here's code that searches for Mixers, and I know it works.

   private static void listSourceDataLines() {

  System.out.println("Available Mixers:");

  Mixer.Info[] aInfos = AudioSystem.getMixerInfo();

  for (int i = 0; i < aInfos.length; i++)

  {

  Mixer mixer = AudioSystem.getMixer(aInfos[i]);

  //mixer.open();

  Line.Info[] lines = mixer.getSourceLineInfo();

           System.out.println(aInfos[i].getName());

    for (int j=0; j<lines.length; j++) {

    System.out.println("  "+lines[j].toString());

    if (lines[j] instanceof DataLine.Info) {

        AudioFormat[] formats = ((DataLine.Info)lines[j]).getFormats();

    for (int k=0; k<formats.length; k++) {

    System.out.println("    "+formats[k].toString());

    }

    }

    }

  }

}

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 10 2014
Added on May 12 2014
1 comment
1,562 views