9

Is there a way to get the sound from the default audio output for the computer? I don't want to manipulate it, I just want to make a visual representation of the frequencies; much like an equalizer.

Jtvd78
  • 4,135
  • 5
  • 20
  • 21

2 Answers2

0

This question is duplicate of:

Real Time Audio Visualization Java

The java sound API lets you interact with the current audio output. You can find the reference here:

http://www.java-tips.org/java-se-tips/javax.sound/capturing-audio-with-java-sound-api.html

Community
  • 1
  • 1
Swift
  • 13,118
  • 5
  • 56
  • 80
  • 4
    both the links have nothing to do with the question. They state how to send output, but the question is how to record the default sound output for the computer, for e.g. record the song being played on WMP. – coding_idiot Oct 01 '13 at 20:02
-1

Mac computers do not feed audio output back into the computer for programs to access, and since everything in java has to work on both mac and windows computers, they cannot provide specific access to this feature to windows users either. Windows computers might provide an input device which you can access representing system output, I'm not sure about it, but you could find out with

AudioSystem.getMixerInfo()

It returns a list of objects containing strings for the name, description, version, and vendor of every available audio device. Printing these on a loop lets you look at all the audio devices. If none of them look like they could be the widows system output feedback then you are out of luck, unless you want to use native classes. I'm not going into that here but there is a good page about them here.

Zac
  • 347
  • 3
  • 8
  • 1
    It gives you the list - but how to know which device is currently selected for playback by the user? – mvmn Oct 07 '21 at 12:16