sound function return???

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
dciris
DCEmu Junior
DCEmu Junior
Posts: 42
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Feb 06, 2003 3:51 pm
Has thanked: 0
Been thanked: 0

sound function return???

Post by dciris »

I was wondering if when this function is called:

snd_sfx_play(sound2[snd_bgm], 1000, 1);

It could return a varibable indicating wheter its on or off (ie: return 0 (off)
return (1) on). This way, If 0 was returned I could call the function a gain for a seamless sound loop... :?
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

I think it returns the channel the sound is playing on. There used to be a function to check if a sound was playing on a given channel, but I think it disappeared somewhere.
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Post by nymus »

Could someone tell me what the (regexp) for c++ is? ie how to write "c++" as a regular expression takin into account that "+" must be escaped.

c\\+\+?? Thanks for your help. I'm having browser trouble :(
behold the mind
inspired by Dreamcast
MindChild
DCEmu Junior
DCEmu Junior
Posts: 47
Joined: Mon Mar 03, 2003 11:36 am
Location: Somewhere
Has thanked: 0
Been thanked: 0
Contact:

Post by MindChild »

C\+\+
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Post by nymus »

that didn't/doesn't work MindChild :( But, it's okay.

dciris, maybe there's a way to check how far into your sound buffer it has read? That might work.
behold the mind
inspired by Dreamcast
dciris
DCEmu Junior
DCEmu Junior
Posts: 42
Joined: Thu Feb 06, 2003 3:51 pm
Has thanked: 0
Been thanked: 0

Post by dciris »

thanks very much for all your replys guys :D
I will definately look into reading the soundbuffer (its an uncharted territory like most of the other programming so far:P )...

I was wondering also if you guys know about a time function that would return milliseconds so far I have only been able to find one for full seconds the reason I'm looking for this function is for animating textures...

thanks very much
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

Code: Select all

void timer_ms_gettime(uint32 *secs, uint32 *msecs);
If you want just the number of milliseconds elapsed since the DC was booted, you can do this:

Code: Select all

int secs, msecs;
timer_ms_gettime(&secs, &msecs);
msecs += secs * 1000;
Or, to convert it to seconds as a floating point value:

Code: Select all

int secs, msecs;
float time;
timer_ms_gettime(&secs, &msecs);
time = secs + (msecs / 1000.0f);
dciris
DCEmu Junior
DCEmu Junior
Posts: 42
Joined: Thu Feb 06, 2003 3:51 pm
Has thanked: 0
Been thanked: 0

Post by dciris »

thanks very much BlackAura :D
Post Reply