LineUnavailableExceptions when using build4
I get many exceptions like the one below every frame after converting my app to build4, and to JavaSoundMixer from HeadSpaceMixer. It still plays the sounds I ask it to though. The exceptions come even if I play no sounds, but if nothing moves in my scene the exceptions stop coming.
Based on what the API stipulates will happen if all available Channels are in use this can not be taken as expected behavior and must be a bug?:
Sound Priority is used to rank concurrently playing sounds in order of importance during playback. When more sounds are started than the AudioDevice can handle, the sound node with the lowest priority ranking is deactivated (but continues playing silently). If a sound is deactivated (due to a sound with a higher priority being started), it is automatically re-activated when resources become available (e.g., when a sound with a higher priority finishes playing), or when the ordering of sound nodes are changed due to a change in a sound node's priority.
Sounds with a lower priority than sound that can not be played due to lack of channels will be played. For example, assume we have eight channels available for playing sounds. After ordering four sounds, we begin playing them in order, checking if the number of channels required to play a given sound are actually available before the sound is played. Furthermore, say the first sound needs three channels to play, the second sound needs four channels, the third sound needs three channels and the fourth sound needs only one channel. The first and second sounds can be started because they require seven of the eight available channels. The third sound can not be audibly started because it requires three channels and only one is still available. Consequently, the third sound starts playing 'silently.' The fourth sound can and will be started since it only requires one channel. The third sound will be made audible when three channels become available (i.e., when the first or second sound finishes playing).
Sounds given the same priority are ordered randomly. If the application wants a specific ordering, it must assign unique priorities to each sound.
Methods to determine what audio output resources are required for playing a Sound node on a particular AudioDevice and to determine the currently available audio output resources are described in the AudioDevice class.
javax.sound.sampled.LineUnavailableException: No Free Voices
at com.sun.media.sound.MixerClip.nSetup(Native Method)
at com.sun.j3d.audioengines.javasound.JSClip.initDataLine(Unknown Source)
at com.sun.j3d.audioengines.javasound.JSSample.load(Unknown Source)
at com.sun.j3d.audioengines.javasound.JavaSoundMixer.prepareSound(Unknown Source)
at javax.media.j3d.SoundScheduler.attachSoundData(Unknown Source)
at javax.media.j3d.SoundScheduler.processSoundAtom(Unknown Source)
at javax.media.j3d.SoundScheduler.calcSchedulingAction(Unknown Source)
at javax.media.j3d.SoundScheduler.renderChanges(Unknown Source)
at javax.media.j3d.SoundScheduler.processMessages(Unknown Source)
at javax.media.j3d.StructureUpdateThread.doWork(Unknown Source)
at javax.media.j3d.J3dThread.run(Unknown Source)