sfxr for Haxe
I just finished porting sfxr to Haxe, but as a library instead of an app. Instead of generating a WAV file in sfxr and storing it in your SWF, you can now generate it while your program is loading, or the moment you need it. Why? To save space in the final SWF and to provide more flexibility, like being able to vary a sound a little depending on something in the game.
http://www.wieringsoftware.nl/ld/sfxrhx/
There are several ways to use it:
- you can start with making a sound in sfxr and save it as a .sfs file and use the load() function
- generate random sounds in your program and simply save the random seeds of the ones you like, use create(), randomize() and mutate()
- if you need to fine-tune a sound, you can also edit the individual parameters in your program
- use generate() to create the wave file in memory
- finally, use play() at any time to play it
You are a god. I have been meaning to do this for ages.
Oh wow! I’ve been idly thinking of doing that for a long time now, only as3 instead of Haxe. Probably very easy to port to as3 from Haxe (or I can just load up a separate swf).
I just finished porting sfxr to as3, with some bonus features too. Like your’s, you can use it as a library in your as3 projects to save on space, but I also ported the app.
http://superflashbros.net/as3sfxr/
http://code.google.com/p/as3sfxr/
Tom-
That’s great!
I just added the function setSettingsString to the haxe version to use strings from your app.
I also added a transpose function to set the pitch of a sound to an actual note (so you could use them to play simple tunes).
Cool. Now will you do complete flash playback code for musagi songs please?
Just point me at the source and I’ll get right on it
Tom-
Haha, the bit.ly link for this page is OMGv1.
[...] Posted by dobosbence in Projects. Tagged: Flash, haXe. Leave a Comment Ludum Dare » Blog Archive » sfxr for Haxe [...]