Java: capturing sound output

Is it possible to capture the computer's sound output with Java?

I can capture the microphone, but this is not what I need. I need to capture part of the sound that the computer is playing. I can't understand it

thank you

Solution

I think it is possible only if you have virtual audiodevice (native sound card driver "what u hear" function, virtual audio cable, virtual audio streaming or similar function) After that, you just need to find the mixer corresponding to the virtual audiodevice and create the targetdataline

You can do this by modifying the following code example:

Mixer.Info[] mixersInfo = AudioSystem.getMixerInfo();

//select virtual audiodevice by vendor name,device name or version
Mixer.Info selectedMixerInfo = mixersInfo[0];
TargetDataLine recordLine = AudioSystem.getTargetDataLine(aAudioFormat,selectedMixerInfo);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>