Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to play synthesized sound in the browser using JavaScript?

I just came across a Nintendo emulator written entirely in JavaScript on the interwebs, but it doesn't have sound. It got me thinking: Is there any way to synthesize sound in the browser using JavaScript and then play it? If it's not possible in general, then are there any Safari/Opera/FireFox/IE/Etc. extensions that would make it possible?

I am not asking about techniques for synthesizing sound, just techniques for playing sounds that have been synthesized by code running in the browser.

like image 991
PeterAllenWebb Avatar asked Mar 01 '23 03:03

PeterAllenWebb


1 Answers

I would imagine your best bet is to have Javascript talk to Flash using ExternalInterface (http://www.adobe.com/devnet/flash/articles/external_interface.html). Flash now has a way of transfering data between the sound buffers and a general purpose ByteArray classs.

http://www.adobe.com/devnet/flash/articles/dynamic_sound_generation/

You can develop Flash for free using the Flex SDK http://www.adobe.com/products/flex/.

like image 182
Jotham Avatar answered Apr 25 '23 20:04

Jotham