Question

I am doing a science project where I am attempting to create a video game that can be played by the blind so sound is the medium by which the game is played and there is no graphics. I've coded the game in UnityScript and have used canvas elements to help me see what I am doing.

I'm having problems implementing sound in my game. My original idea was to just code in html5 and use the tag to add sound. I quickly found that the tag doesn't have many functions. I need to be able to change the pitch and speed of a sound and also be able to use 3d directional hearing. I did some more research and found out about web audio api. I messed around with it and couldn't figure it out but I decided to figure it out later and continued coding my game. I am now finished with my game and still can't figure it out.

  1. Is there an obvious reason why web audio api wont work because I've looked at every tutorial online and can't figure it out. Its driving me crazy.

  2. I've thought of using a program such as Unity3d to implement sound in my game and it would also help me export it to many platforms. Would this work and be a good idea?

  3. Is there any other way to get this to work.

Thank You, any help is appreciated.

Was it helpful?

Solution

I've found the Web Audio API to be kind of a pain to work with. I'd recommend checking out a library like band.js. As for your questions, 1) I wouldn't know without seeing your code, I remember long ago needing to enable it in a browser, but those days are probably over. Post a fiddle and I'll check it out.

2) If you plan on making more games, Unity is a really good engine to learn. The benefit from learning that would probably exceed any learning curve you incurred getting sound into your game.

3) If 3d directional hearing is your goal, it's going to be a challenge. Especially since there is a lack of audio tutorials online.

Sorry this probably isn't a big help, but sound is tough. Good luck.

OTHER TIPS

I'm not sure what problems you are having with the audio api? Maybe you could eleborate?

As for Unity you would have no problems implementing those types of audio effects in a 3D environment.

http://docs.unity3d.com/Documentation/Components/class-AudioSource.html

Also Unity uses UnityScript which is based on JavaScript and looks identical most of the time so hopefully you wouldn't have too much trouble porting the code.

http://wiki.unity3d.com/index.php?title=UnityScript_versus_JavaScript

But if you can get the audio api running that might be the better option if time is tight!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top