Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the speaker audio signal and then streaming it out

I am trying to build what I think is a basic app. Well, two apps one for windows and one for OS X. I would like to capture the audio signal that is playing (ie if the user is playing music out his/her speakers). Then take that signal and stream it out so another computer can "listen". The other computer would be Windows or OS X.

  1. Any ideas on how to get the audio signal?
  2. What's the most efficient way to stream out audio without a 3rd party plugin? If there is an open-source solution out there, I would be interested.

Thanks!

Chris

like image 819
chrishomer Avatar asked Jul 09 '09 14:07

chrishomer


People also ask

What is audio in and audio out?

An audio output, or also known as audio out, drives a signal (digital or analog) into another device's audio input. They are found on audio-generating devices such as your TV or computers.

How do I fix my audio streaming?

Check your audio input and output settings and be sure to specify which audio devices to use for each. A common, easily solvable, issue is to check if an audio device or source is muted, and to raise the output or recording volume. If it's a software issue, begin by updating your streaming app.

Why is there no sound when I stream?

Check if the TV volume is set extremely low or muted. Check if the sound is working from other non-app sources such as TV channels, etc. Note: If there's no sound from other sources besides the apps, refer to the no sound section of the BRAVIA TV troubleshooting guide instead.


1 Answers

On Windows XP this isn't trivial at all because there's no way of intercepting the output signal without writing an audio filter driver (which is not somethign for the faint of heart).

On Windows Vista and above, you can capture the output of the audio engine by using the WASAPI APIs (built into Windows so they're free) and initializing an audio client with the AUDCLNT_STREAMFLAGS_LOOPBACK flag. This will give you a capture stream that's hooked to the output of the audio engine.

You can then package up that audio and send it to the other machine and render it with whatever audio rendering API you want.

I don't know how to do the equivilant on OSX though :(.

like image 131
ReinstateMonica Larry Osterman Avatar answered Oct 17 '22 07:10

ReinstateMonica Larry Osterman