Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by FelipeBudinich

I guess we are all aware of the multiple issues with audio in html5, so I was wondering, would it be possible to add something like Audia to Impact ( http://www.lostdecadegames.com/audia-is-a-library-for-simplifying-the-web-audio-api/ ).

I've tested it expanding the example provided, and it does fix a lot of the common issues with audio (try looping a short sample, it works beautifully!).

I would try to do it myself, but i'm a javascript noob (learning by leaps and bounds due to the exposure to this wonderful framework), and this library uses "prototype", that confused the hell out of me.

Maybe if someone could tell me how to create the AudioContext from within Impact (and guide me while I untangle that "prototype" mess), I could port this as a plugin, what do you guys/gals think?

1 decade ago by Chmood

I didn't heard about this project, though I knew of :

- The Web Audio API, on which is base Audia (https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html).

- And the Audio Data API (https://wiki.mozilla.org/Audio_Data_API)

Also have a look on Sound Manager, a Flash fallback for web audio, relying on audio data API (http://www.schillmania.com/projects/soundmanager2/)

Still so much work to be (re)done on HTML5 Audio, it's a pity...

Some other audio related javascript promising libs :

- processing.js, which is focused on rapid rendering on audio and video (http://processingjs.org/)

- one-liner chiptune synths (choice of my heart) : http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html

Gonna experiment with this new Audia tool, to see (and hear) what it is capable of :p

1 decade ago by Arantor

and guide me while I untangle that "prototype" mess


You're not supposed to edit that. Basically, in JavaScript, pretty much everything is a type of object, and you can extend that object by adding things to its prototype (so that when you create another of its kind, the new one has the extra methods)

I think right now you're actually wasting your time with the Audio Data API because it's not that widely supported (AFAIK only Chrome supports it, which means that the rest of your users can't use it)

1 decade ago by FelipeBudinich

I think right now you're actually wasting your time with the Audio Data API because it's not that widely supported (AFAIK only Chrome supports it, which means that the rest of your users can't use it)


I'm aware of that (tho there is a webkit AudioContext, and Audia abstracts the use of either), it wouldn't be too hard to fall back to the current audio implementation if the browser does not support it.

You're not supposed to edit that. Basically, in JavaScript, pretty much everything is a type of object, and you can extend that object by adding things to its prototype (so that when you create another of its kind, the new one has the extra methods)


Last night I went on to read about prototype, and while i still think it's ugly, I still would like to have the usual "Module, Class, Function" that you see in impact, if only for consistency. I can see why it would be useful to add methods on the fly during the game loop, but I think it's not tidy enough.

1 decade ago by Arantor

tho there is a webkit AudioContext


How do you think Chrome has it? ;)

I still would like to have the usual "Module, Class, Function" that you see in impact


The whole basis of using object prototypes to extend methods is only low level functionality, you do not have to use it yourself to do anything. I've done a number of Impact projects and not once used Object.prototype or anything to extend anything, since Impact has its own class wrapper which deals with extending and inheritance for you.
Page 1 of 1
« first « previous next › last »