Most advanced SoundManager

Software: Other

ASWC, Member
Posted: 22 April 2013 12:39 PM   Total Posts: 76

I’ll be posting some of my classes on this portal starting with this one:
http://aswebcreations.com/framework/index.php/soundmanager/

   

SuperSam, Sr. Member
Posted: 22 April 2013 01:26 PM   Total Posts: 102   [ # 1 ]

Interesting, thanks for sharing ! If the code is documented as it looks, I might use it in a bigger project once I’m more comfortable with Away3D.

A few questions, remarks or ideas:

- I didn’t know static functions were faster on mobile. I think they’re slower than class instance methods on desktop and I assumed it was the same on mobile. Good to know, I’ll keep that in mind for double checking smile

- Concerning your GC and purge functions, do they actually trigger the GC manually, or do they dispose and free a bunch of references for the next time Flash thinks it’s good to do garbage collection ? I think the latter would be preferable as the VM might take whatever is occurring on the host computer into account when deciding to run GC or wait a bit.

- Most importantly, do you have a handy feature set to enable 3D sound ? I know this isn’t particularly hard to build that yourself in a 3D game, but it could be fun to add an optional notion of position in space into your SoundManager. Then to be super fancy there are Doppler effects to be added based on motion of emitting source relative to the player, but I think that last one might be too much CPU strain to be worth it in Flash wink

- Music ! Is the API convenient to affect music ? It benefits to sounds as well, so it might be good to include. I’m talking about being able to modify rhythm, pitch and all other English terms that are used by musicians and “sound artists”.

   

ASWC, Member
Posted: 22 April 2013 01:49 PM   Total Posts: 76   [ # 2 ]

I try to keep my classes as less intrusive as possible that’s why you have many ways with that SoundManager to get back the SoundChannel so you can still do whatever you want with it including 3D effects and other manipulations while keeping the overall control with the SoundManager. That’s really the goal of this class, give you sound control but let you free to do more with it. As for gc and purge they do not trigger the gc since that would also be intrusive. The coder should stay in charge of this. I think any additional functionality like 3D effect, pitch and so on should not be part of the SoundManager itself but added as plugins if they were to be implemented. Thx for your feedbacks!

   

SuperSam, Sr. Member
Posted: 22 April 2013 01:53 PM   Total Posts: 102   [ # 3 ]

Yes I agree, they should not get in your way unless you explicitly want them. Sounds good then smile

I’ll give it a try.

   

ASWC, Member
Posted: 22 April 2013 02:05 PM   Total Posts: 76   [ # 4 ]

Let me know how it goes! wink

   

ASWC, Member
Posted: 22 April 2013 02:10 PM   Total Posts: 76   [ # 5 ]

This is my reference concerning the use of static functions:
http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
Since I wanted that class to be very mobile friendly.

   

SuperSam, Sr. Member
Posted: 22 April 2013 04:03 PM   Total Posts: 102   [ # 6 ]

It’s from Adobe so I must have dreamt or something, and static functions are also faster than class instance ones on desktop. I’ll give it a try eventually. Even if it was not the case, mobile requires more optimization than desktop it’s a fair decision you took.

Maybe you can benefit from ASC 2.0’s inlining and get even better results ? I use Haxe so I don’t know how restrictive ASC 2 is with inlining (I think quite horribly so), but it’s worth a look if you need more speed smile

   

ASWC, Member
Posted: 22 April 2013 04:17 PM   Total Posts: 76   [ # 7 ]

Unlike my version 3 this version 4 does not support FP9 so I already took a step forward lol. I prefer to support as much FP version and inlining is only starting with FP11.7 so not for now. wink

   

SuperSam, Sr. Member
Posted: 22 April 2013 08:57 PM   Total Posts: 102   [ # 8 ]

I don’t think so, it’s a compiler feature so it shouldn’t rely on a specific version of Flash or Air.

ASC 2.0 is present in Air SDK 3.7 but you can target earlier Flash runtimes. I just gave it a try and decompiled a 11.0 SWF in which I inlined a function, and it did appear to work.

It should work on FP10 too and any version so long as AS3 is used. The reason I didn’t target earlier than 11.0 is that my project relies on Away3D 4 smile


That said, I prefer Haxe inlining. More powerful !

   

ASWC, Member
Posted: 22 April 2013 10:05 PM   Total Posts: 76   [ # 9 ]

Wasn’t sure but good to know. Right now this class is just something I use regularly so I’m sharing it in case other people might find it useful. But if a lot of people like it and use it then I’ll put it on github and push it further. We’ll see. For now that’s what it is.

   

ASWC, Member
Posted: 26 April 2013 09:33 PM   Total Posts: 76   [ # 10 ]

http://www.actionscript.org/resources/articles/1116/1/SoundManager-40/Page1.html

   

ASWC, Member
Posted: 28 April 2013 06:52 PM   Total Posts: 76   [ # 11 ]

New Update SoundManager 4.1.0.

# Fixed event dispatching
# added addEventListener static.
# removed all ASWCTween and replaced by specific high speed volumetween.
# removed fadeIn and fadeOut and replaced by fade.
# fade can now fade loopimg sounds or group of sounds. (for example a looping sound with a duration of 2 seconds can be faded accross 10 seconds. It will fade and loop seamlessly)

   

ASWC, Member
Posted: 11 May 2013 03:50 AM   Total Posts: 76   [ # 12 ]

This is now a code.google project.
http://code.google.com/p/advanced-sound-manager/
Feel free to request more features and to share your feedbacks. wink
On the works:
- distance. Sound volume change according to object distance.
- spatial. Sound left and right pan change according to character placement.

   

ASWC, Member
Posted: 12 May 2013 12:11 AM   Total Posts: 76   [ # 13 ]

Now play sounds according to object distance in SM 4.1.1:
http://aswebcreations.com/framework/index.php/soundmanager-4-1-1-play-a-distant-sound/
3D and non linear volume coming next.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X