0
0

Hi there,

I’m working on a custom 3d Sound Engine overrride for my half-life mod, using FMOD. The question i have about this is (since i can’t seem to find any actual documentation on it..) Is that if FSOUND_STREAMABLE is flagged on a sample load, will it automatically stream if it can?

Because it’s for a Half-Life modification, mappers etc can use any custom sound they want for their map. I want to leave them the ability to use large audio files for positional ambient looping sounds, but i don’t want to be loading 5+mb ogg vorbis files into memory! Theres no easy way to check if its a streamable sample or not from the filename, so I was hoping that it would indeed stream. (I’m still in the main conceptual/drafting stage of my classes, so i have yet to test it, I’d just like to know before i get too far into this)

Any help/knowledge would be greatly appreciated!

Thanks!

  • You must to post comments
0
0

No, it won’t automatically stream if you pass FSOUND_STREAMABLE to FSOUND_Sample_Load.

Check out the “stream” example in the fmod api. Basically, if you want to stream a sound you need to use FSOUND_Stream_OpenFile and FSOUND_Stream_Play.

  • You must to post comments
0
0

:/

okay that dissapoints me. looks like i won’t be able to use FMOD for this afterall.. i need to be able to check if a file should be streamed at sample-load, automatically. if it should be streamed, stream it. oh well. i guess ive gotta look for alternatives now :(

  • You must to post comments
0
0

You can’t call FSOUND_Sample_Load and expect it to create a stream. If you want to create a stream, use FSOUND_Stream_OpenFile.

Can’t you just check the size of the file and choose to either load it or stream it?

  • You must to post comments
0
0

hmm..

that could work, the only problem is I have no idea how to check the filesize without actually loading it first.

Any suggestion on that? =)

I’ve been searching places such as MSDN, and I’m about to hop to another site to see if i can figure it out, but i’ll keep my eye open for your reply, if you reply again.

Thanks though, i really DO want to use FMOD..

  • You must to post comments
0
0

Use _stat :

[code:13b03xy9] #include <sys/stat.h>
struct _stat buf;
unsigned long mp3size = 0;
if (_stat("sound.mp3", &buf) == 0)
{
mp3size = buf.st_size;
}
[/code:13b03xy9]

Check out msdn if you need more info on how to use it.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.