🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Omgwtfcode

posted in DruinkJournal
Published September 23, 2005
Advertisement
Ok, I was wrong. My friends idea of "the entire day" is 5pm till 8pm. Still it's better than nothing I guess. She's supposed to be phoning me when she's finished organising accomodation with another of her friends, so I can persuade her to stay with me tonight. Completely innocent, it's just that we're supposed to be going to the botanical gardens tomorrow, then ice skating at 2:30, and if she's here already, then I won't be waiting till 5pm to see her. Also, it takes about 45 mins for her to get home, and another 45 mins back (And it'll cost GBP10 or so [whatever the train fare is]), whereas I can pick her up from wherever she is and bring her back here in 30.
Anyway, the plus side of not seeing her till 5 was that I got some coding done, and my program now has a nicely threaded sound manager. Sample usage:
CSoundBuffer* pMusic = CSoundManager::Get().LoadOgg("Data/Music/The Lake Protocol.ogg");bool bLooping = true;pMusic->Play(bLooping);
And then when you want to stop the sound, you just call CSoundBuffer::Release(), and it stops the sound and cleans up the buffer for you. Awesome.
I'd like to add some sort of buffer recycling for static sounds, so I don't end up creating and destroying buffers all th time, which I know is going to rape my performance.
At the moment I only support OGG files, but I'll probably add support for WAVs too. Since everything goes into my BZ2 packed data pack, WAVs shouldn't end up huge. Although they might compress better as OGG (but they won't get BZ2'd). Anyway, I'll see what works best. The decoding speed isn't really an issue, since short sounds will be stuffed into a buffer all in one, and longer sounds should be streaming anyway, and I only stream every 500ms.

In other news: My bed arrived! Yay! Oddly enough it looks exactly like the picture a few entires down (Except blue and white checked duvet and pillow covers), so I won't bother taking a photo or anything. Well, I might tomorrow, we'll see.

Right. Time to get some more coding done; the buffer recycling thing I mentioned I think. And wait on the phone.
0 likes 3 comments

Comments

H_o_p_s
I like that sound manager... nice!
September 23, 2005 05:02 PM
ukdeveloper
What happened to your old bed?
September 24, 2005 03:16 AM
Evil Steve
I meantioned what happened to my old bed a few posts down. Basically, two of my fatass friend sat on it, and it shattered.

My sound manager is completely isolated from the rest of my code (With the exception of the DebugLog() function). I'll get the buffer recycling done, add a little more functionality, then I may as well release it for general usage.

Edit: Oh. I lied. I forgot that my sound manager uses my resource manager to load data. I think I'll adjust that slightly so you can pass in a pointer and a length. That would be slightly better (And it'll let me reuse my own code better [smile])
September 24, 2005 06:57 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement