Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to select the output device for an audio from a web page?

The web app I'm building has audio notifications and a video conference option, so the user normally is going to have speakers and a headset connected to the PC, my client wants that the audio notifications will be played in the main speakers, and the video conference can be done using the headset.

Right now I'm using all html5 for audio and webRTC for video conference, I couldn't find any info about how to do this. May be with flash but not can't find this either.

like image 465
Marcelo A Avatar asked Feb 07 '13 20:02

Marcelo A


People also ask

How do I change my browser audio output device?

Press “Open Sound settings.” Scroll down and press “App volume and device preferences” under “Advanced sound options.” Find the program or app for which you want to customize the audio output device and press the lower arrow on the right. Select the desired audio output device.

How do I choose audio output for Chrome?

How to: Click on the extension icon and choose the output device on the website you want to play audio out of. Note: you will need to authorize the microphone permission that pops up due to chrome restrictions. Once you have done so choose the device again and it will work with the current site in the open chrome tab.

How do I choose audio output?

Tap the small button at the top right of the player notification tile. In the media player pop-up, you'll see a list of connected audio devices. Tap the one you want to switch to.


3 Answers

Solutions in this space are emerging via the use of WebRTC. You can see a sample of a working solution at https://webrtc.github.io/samples/src/content/devices/input-output/

Browser support for this is limited right now though.

like image 111
Mark Avatar answered Nov 15 '22 18:11

Mark


There is now an HTML5 audio device redirector Chrome extension called AudioPick. The website is here: https://rain-fighters.github.io/AudioPick/

This is OpenSource under the GNU public license, with a Github repo.

There are some limitations (no Flash sources, and some types of HTML5 sources also will not be found), as indicated on the homepage.

like image 30
LightCC Avatar answered Nov 15 '22 18:11

LightCC


Actually sound output is only on Oslevel ... you may have to read about the chrome.audio API which still on experimental level ... "The chrome.audio API is provided to allow users to get information about and control the audio devices attached to the system. This API is currently only implemented for ChromeOS. "

I thnik this would help if it was availble for all OS so you could redirect sound using this API ... As exemple of some methods from this API i can list :

getInfo − chrome.audio.getInfo(function callback) 

which return all audio output and input devices

setActiveDevices − chrome.audio.setActiveDevices(array of string ids, function callback)

which sets the active devices to the devices specified by |ids|

The problem is Chrome.audio API is only for ChromeOS and sounds output is controlled by other OS... that's it two parallel lines..

like image 24
ELBartoTn Avatar answered Nov 15 '22 20:11

ELBartoTn