mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Fix semi random volume jumps
This commit is contained in:
parent
f0aa1a8cae
commit
c077500d16
1 changed files with 5 additions and 2 deletions
|
@ -165,6 +165,7 @@ end:
|
|||
vlog_error("Unable to queue sound buffer");
|
||||
return;
|
||||
}
|
||||
FAudioVoice_SetVolume(voices[i], volume, FAUDIO_COMMIT_NOW);
|
||||
if (FAudioSourceVoice_Start(voices[i], 0, FAUDIO_COMMIT_NOW))
|
||||
{
|
||||
vlog_error("Unable to start voice processing");
|
||||
|
@ -229,10 +230,10 @@ end:
|
|||
|
||||
static void SetVolume(int soundVolume)
|
||||
{
|
||||
float adj_vol = (float) soundVolume / VVV_MAX_VOLUME;
|
||||
volume = (float) soundVolume / VVV_MAX_VOLUME;
|
||||
for (size_t i = 0; i < VVV_MAX_CHANNELS; i++)
|
||||
{
|
||||
FAudioVoice_SetVolume(voices[i], adj_vol, FAUDIO_COMMIT_NOW);
|
||||
FAudioVoice_SetVolume(voices[i], volume, FAUDIO_COMMIT_NOW);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,8 +243,10 @@ end:
|
|||
bool valid;
|
||||
|
||||
static FAudioSourceVoice** voices;
|
||||
static float volume;
|
||||
};
|
||||
FAudioSourceVoice** SoundTrack::voices = NULL;
|
||||
float SoundTrack::volume;
|
||||
|
||||
class MusicTrack
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue