R Rich Blackmore Member Licensed User Longtime User Oct 26, 2017 #1 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?
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?
Erel B4X founder Staff member Licensed User Longtime User Oct 26, 2017 #2 I don't think that it is possible. Upvote 0
stevel05 Expert Licensed User Longtime User Oct 26, 2017 #3 It should be possible, you will need to wrap (at least partially) javax.sound.sampled.AudioSystem class : https://docs.oracle.com/javase/7/docs/api/index.html?javax/sound/sampled/AudioSystem.html and a few others. Or access them via javaObject. I have been playing with the midi implementation lately and the device management works in a similar manner. It's not that straightforward but doable. Upvote 0
It should be possible, you will need to wrap (at least partially) javax.sound.sampled.AudioSystem class : https://docs.oracle.com/javase/7/docs/api/index.html?javax/sound/sampled/AudioSystem.html and a few others. Or access them via javaObject. I have been playing with the midi implementation lately and the device management works in a similar manner. It's not that straightforward but doable.
stevel05 Expert Licensed User Longtime User Oct 26, 2017 #4 There is a little info here which may help. https://stackoverflow.com/questions/37609430/play-sound-on-specific-sound-device-java Upvote 0
There is a little info here which may help. https://stackoverflow.com/questions/37609430/play-sound-on-specific-sound-device-java
stevel05 Expert Licensed User Longtime User Oct 26, 2017 #5 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: Feb 4, 2020 Upvote 0
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
R Rich Blackmore Member Licensed User Longtime User Nov 16, 2017 #6 Wow that is great.. And works great thank you so much for you efforts will defo use this in my project. Your a star!!! Upvote 0
Wow that is great.. And works great thank you so much for you efforts will defo use this in my project. Your a star!!!
stevel05 Expert Licensed User Longtime User Feb 4, 2020 #7 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: 433 Upvote 0
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.
stevel05 Expert Licensed User Longtime User Feb 4, 2020 #8 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: 490 Upvote 0
And a version that uses inline java instead of reflection in case you are worried by the illegal reflection warnings in Java 11
P Philip Prins Active Member Licensed User Longtime User Feb 24, 2020 #9 stevel05 said: And a version that uses inline java instead of reflection in case you are worried by the illegal reflection warnings in Java 11 Click to expand... Hello Steve, Is this also possible with a stream of bytes from an UDP port? Upvote 0
stevel05 said: And a version that uses inline java instead of reflection in case you are worried by the illegal reflection warnings in Java 11 Click to expand... Hello Steve, Is this also possible with a stream of bytes from an UDP port?
stevel05 Expert Licensed User Longtime User Feb 24, 2020 #10 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
Yes, should be possible provided that the connection is fast enough, there is another example here that may help that doesn't use audioclip.