Google's Songbird Brings Ambisonics To The Web
Google's Songbird Brings Ambisonics To The Web
Written by Mike James   
Wednesday, 30 August 2017

Spatial audio, when done right, is amazing and best through a pair of headphones. We only have two ears, but somehow we manage to hear things in 3D up, down, left, right and back and front. With the advent of the Web Audio API, spatial audio is possible and Songbird makes it easy.

songbird3

How we tell the elevation of a sound source - the different paths change the frequencies we hear.

The ink on the web audio API is only just dry and most modern browsers support it, but it doesn't go quite far enough for some. The Chrome Media Team has created a JavaScript library to make it easier to use and to push what it can do. If you have never experienced spatial audio then I would suggest trying it out but use a pair of good quality headphones.

"For a virtual scene to be truly immersive, stunning visuals need to be accompanied by true spatial audio to create a realistic and believable experience. Spatial audio tools allow developers to include sounds that can come from any direction, and that are associated in 3D space with audio sources, thus completely enveloping the user in 360-degree sound.

Spatial audio helps draw the user into a scene and creates the illusion of entering an entirely new world."

SongBird uses the Omnitone implementation of an ambisonic decoder to create spatial audio in two stereo channels. You can take any number of mono audio sources and place them in 3D space. When you run the program the sound sources create a stereo 3D effect that gives the impression to the listener that the sound sources are where you placed them.

songbird1

You can already do some of this using the audio API standard PannerNode, but Songbird takes things further. It allows you to adjust the quality of localisation and it is computationally more efficient. It also adds room modelling. You can set the size of the room and the materials that is is constructed from. This alters the reverberation time depending on the location of the sounce source and the listener.

Songbird really does make it easy to get started:

var audioContext = new AudioContext();
var songbird = new Songbird(audioContext);
songbird.output.connect(audioContext.destination);
var audioElement = document.createElement('audio'); audioElement.src = 'resources/SpeechSample.wav'; var audioElementSource =
audioContext.createMediaElementSource(audioElement); var source = songbird.createSource(); audioElementSource.connect(source.input);
source.setPosition(-0.707, -0.707, 0);
audioElement.play();

You can also have a listen to the demos on the SongBird site. I don't think they are as impressive as, say, the early demos of DirectSound, but that could be partly choice of source material.

Of course, spatial sound really comes into its own in immersive AR and VR and Songbird is also very similar to the spatial audio available in Google's Daydream VR efforts.

The code is open source and available on GitHub.

 

songbird2

 

More Information

Bringing Real-time Spatial Audio to the Web with Songbird

Songbird: Spatial Audio Encoding on the Web

Related Articles

Google-backed Virtual Reality

See Invisible Motion, Hear Silent

Cardboard Gets 3D Sound API

Sound Hardware

 
 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

Banner


Apache Kylin Adds RDBMS Support
06/09/2017

 Apache Kylin 2.1 has been released with new features including support for RDBMS and the ability to edit metadata model's JSON directly on the web.



Hacking Alexa By Whispering In Her Ear
28/08/2017

Apologies for the over-the-top headline. The technique works with any voice-driven assistant and, yes I know, Alexa doesn't have ears. The idea is simple and it seems fairly effective. It allows you t [ ... ]


More News

 
 

 

blog comments powered by Disqus

 

 

Bringing Real-time Spatial Audio to the Web with Songbird

Last Updated ( Wednesday, 30 August 2017 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.