In Java embedded audio environment, can audio streams have multiple consumers?

Is there an easy way to have multiple independent concurrent consumers for an audio source (like microphone lines) inside a single Java VM instance with Java embedded audio ( javax.sound.sampled.*

)? Since I'm using the TarsosDSP audio processing library anyway , can it help with this problem? Or do I need to implement my own audio mixer?

My current problem is that I want

  • process the audio stream from the microphone input using TarsosDSP (to obtain a spectrogram among other analyzes) and
  • write fragments of this stream for speech-to-text transcription, which may require monitoring the loudness threshold for automatic activation.
+3


source to share


1 answer


I found some information that partially answers my question:

1.3.2. How can I get more than one TargetDataLine

?

Current Java Sound API implementations do not support multiple TargetDataLine

for the same recording source. It is planned to change this behavior. If multichannel sound cards are supported in the future, it may be possible to get different copies TargetDataLine

for different inputs. If you just want to "split" lines, do it in your application. See Also Can I Use Multi-Channel Audio



Thus, this means that at the time of this writing, Java does not support multiple consumers in the same recording source and will probably not be supported in the future. This leaves me to implement my own solution or find a library with an existing solution.

+1


source







All Articles