Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

MIDI OUT transmitter not available?

Thread view: 
Andrew - 31 Dec 2006 01:35 GMT
I don't get this, it was working before, but then my program
quasi-randomly stopped playing sound, and started instead of giving me
an error message:

javax.sound.midi.MidiUnavailableException: MIDI OUT transmitter not
available
       at
com.sun.media.sound.AbstractMidiDevice.createTransmitter(AbstractMidiDevice.java:444)
       at
com.sun.media.sound.AbstractMidiDevice.getTransmitter(AbstractMidiDevice.java:299)

I am trying to write a sound/music system for a game, and I want it to
be reusable for other programs that I make (probably other games). I
have created a Note class and a MidiKit class to do this. The Note
class stores channel, pitch, velocity, and duration info, and a
reference to a Receiver created by my Synthesizer object.

I used a system I found somewhere on the internet to find all of the
MidiDevices and removed everything that wasn't a synthesizer, giving me
only one device! If, however, the program finds more devices, it picks
the one with the highest value of getMaxPolyphony(). Nonetheless, I am
only getting one device, and it has a getMaxTransmitters value of zero
and an empty list for getTransmitters(). What can I do?
Andrew Thompson - 31 Dec 2006 02:51 GMT
> I don't get this, ..

Neither do I. (1)

> javax.sound.midi.MidiUnavailableException: MIDI OUT transmitter not
...
> ....I have created a Note class and a MidiKit class to do this....

Thats interesting. (2)

> I used a system I found somewhere on the internet ..

That's big. (3)

> ... What can I do?

(1) I don't understand this, but given the lack of detail,
it is not surprising.  You might help rectify that by
condensing the code mentioned in (2) & (3) to an
SSCCE(4) that anybody can run, and see fail.

(4) http://www.physci.org/codes/sscce

OTOH - it might be the code is not properly
closing and releasing sound resources.

Andrew T.
Andrew - 31 Dec 2006 03:51 GMT
Um... thanks?

But, as it turned out, it was something really really stupid causing
it.

I had set a variable called baseoctave to have a default value of 60
instead of 5. Apparently the Java MIDI system skips sounds that it
can't play, and my system allowed it to skip them without waiting until
the sound ended.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.