0
0

I want to lower the volume of certain channels or samples. But all the methods I’ve tried ( FSOUND_Sample_SetDefaults, FSOUND_SetVolume, FSOUND_SetVolumeAbsolute ) lead to no change in volume. I always use the same reserved channel 0 in FSOUND_PlaySound and also use this channel as parameter for the volume change methods.
But for channels playing a stream the channel volume methods are working. Also the master volume method FSOUND_SetSFXMasterVolume is working for both, channels playing streams and samples. Any suggestions for getting the channel volume for samples to work?

I use PC version 3.61 of FMOD on WinXP.

Thanks for help,
Snoopy

  • You must to post comments
0
0

After some playing around I found out that the FSOUND_SetVolume is working if I always make this call directly after calling FSOUND_PlaySound.
I would expect FSOUND_SetVolume to set the volume for a channel and remember this setting. But it gets lost every FSOUND_PlaySound call. The help doesn’t mention anything about this. And also FSOUND_Sample_SetDefaults had no effect in my code.
So things are a bit unclear to me. Perhaps I missed something in the documentation or perhaps there’s a problem.

Regards,
Martin

  • You must to post comments
0
0

The way channels work is that they inherit the properties of a sound the
moment it is played. So for the volume example if the sample (or streams)
default volume is 255, then that is what the channel will set the volume to
the moment it is played, which is why SetVolume has to be called after the
sound has been started.

I haven’t tried FSOUND_Sample_SetDefaults, but I would imagine that calling
this before playing a sample would make a channel inherit the defaults that
were set … curious that it’s not working. Just make sure that you are calling
SetDefaluts before trying to start the sound, because the channel will only
inherit the defaults at the moment the sample is played

  • You must to post comments
0
0
  1. FSOUND_Sample_SetDefaults seems not to be working in my program. I tried to call it once after loading the sample and to call it every time before using PlaySound. In either case there was no change in volume. The call FSOUND_Sample_SetDefaults( pfsoundSample, -1, -1, 0, -1 ) returned true.

  2. Brett & Bushido are right regarding FSOUND_SetVolume. Brett’s sample code is working.

2.1 But it would be nice if this behaviour would be explained in the help of FSOUND_SetVolume or else more people than me will get into this trap.

2.2 I don’t think that it’s a very good tactic to do it that way. I understand now that setting the volume each time is a good thing in most cases. But I think it would lead to less confusion if PlaySound had a parameter for the volume ( with a default of 255 ) instead of having to use FSOUND_SetVolume. This is important when you think of multithreading. What if FSOUND begins playing the sample between the play and the setvolume call? I assume there would be a glitch in the volume.

  1. FSOUND_SetMute also acts unexpected for me. I have to call it after each PlaySound call to get a quiet channel. Perhaps here a better explanation in the help would also be usefull.
  • You must to post comments
0
0

[quote="Snoopy":1jqm99cl]
2.2 I don’t think that it’s a very good tactic to do it that way. I understand now that setting the volume each time is a good thing in most cases. But I think it would lead to less confusion if PlaySound had a parameter for the volume ( with a default of 255 ) instead of having to use FSOUND_SetVolume. This is important when you think of multithreading. What if FSOUND begins playing the sample between the play and the setvolume call? I assume there would be a glitch in the volume.
[/quote:1jqm99cl]

Use the PlayEx function, start the sound paused, set the volume and resume it.

  • You must to post comments
0
0

A couple of things:

[quote:1ov4h4so]FSOUND_Sample_SetDefaults( pfsoundSample, -1, -1, 0, -1 )[/quote:1ov4h4so]

The docs are as follows (put them here so you don’t have to go looking for them)

signed char F_API FSOUND_Sample_SetDefaults(
FSOUND_SAMPLE *sptr,
int deffreq,
int defvol, // default volume (you probably knew this anyway)
int defpan,
int defpri
);

You realise in this case you are passing -1 to the defvol – which means that
parameter will be ignored (and hence be whatever vol the sample is currently
at –> 255 if it hasn’t been set before)

  • Also – passing in zero to defpan will make the sound pan to full left
    –> 128 is center (or use FSOUND_STEREOPAN) – see FSOUND_SetPan for more info
  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.