• entries
557
1237
• views
424839

# Omgwtfcode

194 views

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.

I like that sound manager... nice!

What happened to your old bed?

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])

## Create an account

Register a new account