B4J Question Play audio through selected soundcard

Rich Blackmore

Member
Licensed User
Longtime User
I want to play different audio files through multiple sound cards.

So in B4J play audio ring.wav through one usb soundcard then play DTMF.wav through another usb soundcard.


Does anyone know how I can do this?
 

stevel05

Expert
Licensed User
Longtime User
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Out of curiosity, I built the example in the link above, so it should get you started. It just plays a little brass riff on all of the attached output devices. (the wav file is why the file is so large)

Edit amended version in post #7
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It has been bought to my attention that my example was no longer working, I have amended it so it now works again. Please use the attached version.
 

Attachments

  • AudioSystem.zip
    149.4 KB · Views: 250
Upvote 0

stevel05

Expert
Licensed User
Longtime User
And a version that uses inline java instead of reflection in case you are worried by the illegal reflection warnings in Java 11
 

Attachments

  • AudioSystem2.zip
    149.5 KB · Views: 256
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes, should be possible provided that the connection is fast enough, there is another example here that may help that doesn't use audioclip.
 
Upvote 0
Top