How to turn on two audio devices at the same time. Outputting sound to different devices

If I understand well, there are two questions here.

    Is it possible to play sound on two or more audio output devices at the same time and how to achieve this?

    Is it possible to loop the data through an audio input (recording) device so that it plays on the appropriate monitor, for example sent via a Skype audio stream to your partner in your respective case.

Reply to 1: This device is absolutely possible, but all of your system's independent audio outputs can play sounds simultaneously. For example, some professional audio interfaces (for music production) have 8, 16, 64 independent outputs, all of which can be played simultaneously. This means that each output device maintains its own buffer, which it consumes independently (apart from the parallelism in the final shared memory for supplying the buffer).

Most audio frameworks/systems provide functions that allow you to get a "device handle" in which you will need to pass a callback to feed the sample buffer (eg Open AL). This will be called independently and asynchronously by the framework/system (ultimately the audio device drivers). Since this all works asynchronously, you don't necessarily need multithreading. All you have to do basically is support two (or more) audio output devices, each using a separate callback to feed two (or more) separate devices.

Note You can also play multiple sounds on one device. Most devices/systems allow this kind of "resource sharing". In fact, this is one of the purposes for which sound cards are actually designed. Mix all the sounds created by different programs (and therefore take this heavy load off the CPU). When you use one (physical) device to play multiple sounds, the concept is the same as for multiple devices. For each sound you get a logical device handle. Only that these descriptors refer to multiple “channels” of a single physical device.

What should you use?

Open AL seems a bit like using heavy artillery for this simple task I would say (since you don't want What Lots of portability, and probably doesn't plan to implement its own codec and effects ;))

I would recommend you to use Qt here. It's very portable (Win/Mac/Linux) and it has a very handy class that will do the job for you: http://qt-project.org/doc/qt-5.0/qtmultimedia/qaudiooutput.html

Check out the example in the documentation to see how to play a WAV file, with a few lines of code. To play multiple WAV files at the same time, you just need to open multiple QAudioOutputs (basically, output the code from the example into a function and call it as often as you want). Please note that you need to close/stop QAudioOutput for the audio to stop playing.

Reply to 2: What you want to do is called loopback. Only a very limited number of sound cards, e.g. audio devices, provide a so-called loop input device, which allows recording of what is currently output by the main output combination of the sound card, e.g. However, even if such a device is provided, it will not allow you to push anything into the microphone input device. The microphone input device only accepts data from the microphone D/A converter. It's deep in H/W, you can't mix anything at your level.

It will be very hard (IMHO almost impossible) to have Skype send your audio standard setting to your conversation partner. The only thing I can think of is to have an audio device with loopback capabilities (or just physical cable connection with a possible line of monitors on any recording line), and then Skype is configured to use this device with feedback as input, However, Skype will not pick up from the microphone anymore, which means you won't have a conversation ;)

Note: When we say "simultaneous" playback here, we are talking about synchronizing the playback of two sounds as perceived in real time (in the range of 10-20 ms). We're not looking at actual sample-level synchronization and the associated jitter and phase shift issues that arise when transmitting audio over two physical devices with two independent (free working) clocks. Thus, when an application requires phase signal generation on independent devices, clock recovery mechanisms are needed, which can be provided by drivers or the OS.

Note: Software A virtual audio device such as Virtual Audio Cable will provide virtual devices to provide loopback functionality in Windows. Environments like Jack Audio can be the same in a UX environment.

Computer users often ask how to output sound from a microphone to speakers or headphones. In this short article we will describe two ways how this can be done.

Method number 1. Sound settings in Windows.

In order to output sound from the microphone to or headphones, you must first open the sound settings. To do this, right-click on the speaker icon on the taskbar and select “Recording Devices” in the window that appears.

After this, the “Sound” window will appear in front of you, open on the “Record” tab.

This window can also be opened through the “Control Panel”. To do this, you need to go to the “Hardware and Sound – Sound” section. And then, in the “Sound” window, open the “Recording” tab.

So, after you have opened the Sound window under the Recording tab, you need to go to the microphone properties. To do this, select your microphone with the mouse and click on the “Properties” button.

In the microphone properties, go to the “Listen” tab and enable the “Listen with” function there. of this device" Enabling this feature will allow you to output audio from the microphone to your speakers or headphones.

In order to save, close all windows by clicking on the “Ok” button. In order to remove microphone sound from speakers or headphones, simply go to the microphone properties again and disable the “Listen from this device” function.

Method number 2. Sound card settings.

You can also output sound from the microphone to speakers or headphones using your settings. To do this, open the sound card settings and find the microphone settings there.

We output sound to two devices using the program

I stream on my channel zakrutTV and one day I needed output game sound to speakers and headphones simultaneously.

The thing is that I use and therefore I need to transmit the game sound to the second computer and to the headphones at the same time.

There are very simple program, which is called " Audio Repeater"You can easily find it on the Internet.

After successful installation you will have two virtual sound devices. Next install " Line 1"as default device in settings" Sound" - "Playback".

Now run " Audio Repeater (MME)" from the start menu.

Set to field Wave in device " Line 1", and in the field Wave out device " Speakers". Click "Start".

Now let's connect the second device (headphones). Repeat the previous steps, only now set it to the field Wave out device " Headphones".

That's all, now the sound is broadcast to two devices (speakers and headphones). Window Audio Repeater (MME) you can collapse them, after which they will appear in the panel with hidden icons (in the lower right corner).

Read also:

Yesterday my wife and I decided to watch a movie, but in order not to disturb anyone, we had to distribute the sound simultaneously to two pairs of headphones. Some headphones are simple wired ones, which simply intercept the sound from the speakers when you connect them to the laptop, and the second ones are wireless Qumi Concord connected via bluetooth. Is it possible to do this standard means Windows 7?

It turned out that it was quite possible. Most computers these days come with a built-in sound card from RealTek. It requires native drivers to be installed on it, not even necessarily the latest ones, but not the ones that come with Win7 out of the box.

Now I only have sound from the speakers, and the microphone is used from wireless headphones. Open the Recording tab.

Then we turn on the display of all devices, even those that are disabled according to the system.

I have a supposedly disabled software Stereo Mixer on my sound card. After which it needs to be turned on.

And choose to have it play on your second audio output device. In my case it's wireless headphones. After which the system will simultaneously output sound to the speakers (or the first headphones) and additional device, for example wireless.

The fewer cables the better, and it’s hard to argue with that. HDMI is a universal interface that can not only transmit high-quality images, but also output sound. This allows you to reduce the number of wires, because instead of a pair of cables (for audio and video), one universal one is enough. And if you consider that there are plenty of ready-made HDMIs, several meters long, on sale, and long cable with two audio connectors you will have to solder it yourself - this also saves time.

It would seem that outputting sound via HDMI is not a difficult task, but it also has its own nuances. Not always, after connecting the wire, not only the picture, but also the sound begins to be broadcast. In some cases, this requires some more effort.

From a computer that was released not very long ago (no more than 3-5 years ago), outputting sound via HDMI is quite simple. You need to connect the cable at one end to a TV or monitor equipped with speakers (or a 3.5 mm jack for connecting speakers/headphones), and the other end to the picture source (PC video card, or pins on the motherboard if integrated graphics). The picture will be transmitted immediately, but with sound it’s a little more difficult.

Modern video cards are equipped not only with a graphics processor, but also with a sound processor. It is precisely intended to bring out HDMI audio- cable. See if there is a second one on the computer sound card(built into the video card), you can in the “Device Manager”. To get into it, you need to right-click on the computer icon on the desktop and find this item in the left column of the window that opens, or simply enter the search in the Start menu.

In order for sound to be output via HDMI without additional devices, the system must display at least two audio devices. One of them is built into the motherboard, the second is built into the video card. The exception is motherboards equipped with an HDMI output (if graphics integrated into the processor are used): they can have one sound device, the audio outputs of the HDMI connector are connected to it.

On a computer with a video card integrated into the processor, the procedure is simple. Before outputting sound, the HDMI cable only needs to be connected to the monitor/TV and to the connector on the back of the board.

How to configure audio via HDMI on AMD video cards

To output audio via HDMI to a PC that has discrete graphics installed AMD Radeon, you will also have to delve a little into the settings. To do this, you need to launch the “Control Panel” and find the “Sound” submenu there, or simply enter this request into the “Start” menu.

To output sound through the HDMI connector of the video card, you should select the sound processor of the video card (AMD Audio) and click the “Default” button on it. If two screens are connected to the PC in parallel in picture duplication mode, this is not necessary (everything switches automatically).

The disadvantage of this solution is that when outputting sound from a discrete video card, the audio connectors are on the front panel system unit stop working. To fix it, you need to open Radeon Settings (usually the icon is located on the right side of the taskbar, next to the network status, clock and language).

In the menu that opens, you need to open the “Settings” submenu, select “Advanced settings” and find the “Sound” tab on the left. Then you need to connect headphones or speakers to the jack on the front panel. In the window additional settings you should find the output corresponding to the sockets on the panel (if headphones are connected, it will be colored), right-click and select “Set as default” and click the “Apply” button.

Now, when the front connector is connected, sound will be sent to it, and when disconnected, it will be sent to the monitor/TV.

This disadvantage is not present on laptops, just as it is not present on PCs with integrated graphics.

Computer