MIDI OUT transmitter not available?

A

Andrew

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?
 
A

Andrew Thompson

Andrew said:
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.
 
A

Andrew

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top