playsound/freesound question
Displaying 1-7 of 7 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
IkimashoZ

I read a post from McGrue in a previous thread recommending that I load all my sounds in at the beginning of the game and not free them until the end. For the typical use of sound effects, I find this strategy appealing.

I find myself in a unique situation though. In my game, there will eventually be available to the player approximately 720 chinese characters (called "kanji" in Japanese), and I want a pronunciation to play when the player clicks on a kanji. Since I expect the files to average around 40k, this means that following the typical strategy I would have to hold approx. 3 megs of sound files (before songs or any other sound effects) in memory for the duration of the game. I don't like this idea. I would rather free the sound as soon as it is done playing and reuse my kanji_reading_sound variable for whatever kanji the player clicks next.

Looking at the manual, I can't seem to find a way to determine mid if a sound file has finished playing (since, as I discovered, freeing the sound before that point stops the playing of the sound). Any suggestions?

And before anyone asks, yes, I'm making a game (in the true sense of the word), not learning software.

Posted on 2006-11-20 00:50:26

Overkill

Okay, well, I apparently have a SoundIsPlaying(int channel); function on a very old custom build... I'll commit it to the official SVN build, since it really should have been there a long time ago.

EDIT: Committed as of revision 5.

Posted on 2006-11-20 01:06:33 (last edited on 2006-11-20 03:22:34)

IkimashoZ

Sweet. Thanks.

Posted on 2006-11-20 04:28:48

mcgrue

Well, 3 megs isn't really that much at all, really. After all, how much memory does an average instance of a webbrowser or some such eat up?

3 megs is quite a little amount, all told. I regularly run programs with 300+ megs of system resources eaten up. And any modern videogame will pretty much swallow all available resources, like a greedy, greedy... greed-thing.

And you could find that loading the resources and then unloading them and then reloading them, etc etc, could cause unpleasant pauses.

But there are other options open if you still disagree.

Posted on 2006-11-20 06:21:25

IkimashoZ

The computer I'm using now, if I'm remembering correctly, has 512 megs of RAM (This is my work laptop, not my gaming comp, which is at my home in Illinois). How much of that can I have verge fill up before I'll start to notice lag? I guess I'm just used to assuming that there's a limit on the amount of memory I can use. Does verge really give me complete access to ram?

Posted on 2006-11-20 20:39:58

mcgrue

The amount of memory, unless I'm wrong, you're limited to is "that which the OS doesn't need".

I try and stay under 128MB use, personally. Trust me, you'll be fine.

-b

Posted on 2006-11-20 22:06:27

IkimashoZ

Gotcha.
That's quite a bit more memory than I anticipated. Thanks for the heads up.

Posted on 2006-11-21 01:48:59


Displaying 1-7 of 7 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.