|
-
The performance of sound.play()
I'm continually frustrated by the (performance) cost of sound in Flash. I can optimize my app all I want, but in the end, playing a sound is the most time consuming thing that ever happens in a frame.
PHP Code:
var start:int = flash.utils.getTimer();
this.sound.play();
var end:int = flash.utils.getTimer();
trace(end-start);
On my computer, using Flash 9, this averages about 7ms. While I recognize sound isn't going to be instantaneous, 7ms is a lot of time when you only have 20-30 ms to work with per frame.
So I started searching the web, and found surprisingly few discussions of the topic. I guessed this was either:
a) I'm the first person to ever notice this. (unlikely)
b) There's something with my computer that causes sound calls to be exceptionally slow. (probably not, I've tested on two computers)
c) There's something with my version of Flash that causes sound calls to be exceptionally slow.
d) There's something with either my sound files or Flash code that causes the call to be inefficient.
e) It's a well known problem and I just don't know what to Google for.
Any ideas? More importantly, any tips on improving performance?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|