Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 110377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:13:02+00:00 2026-05-11T02:13:02+00:00

This simple code is not producing any sound on a couple of machines that

  • 0

This simple code is not producing any sound on a couple of machines that I’ve used to test it. I’m running the code from within Eclipse, but I’ve also tried using the command line to no avail.

public static void main(String[] args) {     try {         Synthesizer synthesizer = MidiSystem.getSynthesizer();         synthesizer.open();          MidiChannel[] channels = synthesizer.getChannels();          channels[0].noteOn(60, 60);         Thread.sleep(200);         channels[0].noteOff(60);          synthesizer.close();     } catch (Exception e)     {         e.printStackTrace();     } }

I am able to successfully get sound by getting a Sequencer, adding MIDI events to the sequence, and playing the sequence, but I’m trying to do some real-time music effects, which the sequencer does not support.

Any ideas?

EDIT WITH SOLUTION: It turns out the problem is that, by default, the JRE doesn’t come with a soundbank (interesting, then, that using the Sequencer worked, but using the Synthesizer didn’t). Thanks, thejmc!

To solve the problem, I downloaded a soundbank from java.sun.com and placed it in (on WinXP) C:\Program Files\jre1.6.0_07\lib\audio (had to make the audio folder).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:13:03+00:00Added an answer on May 11, 2026 at 2:13 am

    Some installs of the JRE do not include the JavaSound soundbank.gm (in order to save space) so your code would not have a sound source to trigger on those machines.

    Check for the existence of the soundbank on the machines that don’t work. You can also put the soundbank in the same directory as your .class file and it will find it.

    It is possible to add the soundbank or to upgrade the Java install on those machine – the pain of inconsistency, I know 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can not get to make this comparison in this simple code error ..
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
i have this simple code to load data from other php page using get
When I run this simple code: from pylab import * import numpy as np
I don't know why this simple code is not working: int main() { const
I really do not understand why this simple code works fine in the first
this simple code is causing the sp to not compile with all sorts of
I can figure out why this simple code would not compile. May be fresh
I tried compiling and running this simple code but it's throwing error - (void)doSomething
take this simple code: class A{ public: virtual void foo() = 0; void x(){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.