Problem solving: Audio

1 Apr

For the last few days, I’ve been wrestling with one of the biggest problems I had, the audio.

At first, I thought that the audio problems I was experiencing didn’t really affect the game, I thought the sounds were just malfunctioning due to some Flash quirk.

It turns out, after some debugging, that the audio was causing a lot of other problems too. It was causing most of the restarting problems I had been seeing, so I needed to rectify this problem pretty sharpish.

After spending some time finding a new audio framework for flash and then trying to incorporate it and then realising that that didnt work. I then decided to re write the way my code was written because I thought it might be down to an unhandled event listener.

I spent a lot of time re writing things only to find out that those things had nothing to do with my problem. Flash just wouldnt play the sounds I was asking it to.

This was just so weird. No one else seemed to have experienced this problem online, so I tried a solution that I was saving till last because it’s a little strange. Saving all my audio as FLV video files and then playing them that way.

It worked. The audio was now playing reliably and the game could restart and play through as many times as I wanted to.

I still find it so weird that the audio just refused to play like it did. It also, unusually, seemed to happen on about the third play through. One the first and second play, the audio seemed to work okay and then it would crash as at least one audio file wouldnt play and then my game would stop due to the fact the code would try to find and stop a file that wasnt playing or it couldnt find.

Flash is just so strange some times.

Anyway, now that bug has been taken care of, I can move on to more fun things again, like making it look pretty.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: