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

Here is the problem,

The webapp i'm building have audio notifications and a vide 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.

thanks in advance

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.


Simply do this in your javascript code.

 audioElement.setSinkId(deviceId);

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..


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.


Need Your Help

Redirecting /page/xx/ if 404 - IIS / WordPress

wordpress url iis rewrite http-status-code-404

Running WordPress (PHP / MySQL) on Windows Server 2012 R2 / IIS.

Unit tests only run automatically when active SDK is "simulator"?

iphone xcode ocunit

I have followed the instructions Apple publishes for unit testing applications on iPhone and things work great when I set the active SDK to "iPhone Simulator". I have it configured to always build ...