diff --git a/client/src/audio.c b/client/src/audio.c index 1a5d1f9a..5b4480a2 100644 --- a/client/src/audio.c +++ b/client/src/audio.c @@ -432,7 +432,8 @@ void audio_playbackStop(void) void audio_playbackVolume(int channels, const uint16_t volume[]) { - if (!audio.audioDev || !audio.audioDev->playback.volume) + if (!audio.audioDev || !audio.audioDev->playback.volume || + !g_params.audioSyncVolume) return; // store the values so we can restore the state if the stream is restarted @@ -887,7 +888,8 @@ void audio_recordToggleKeybind(int sc, void * opaque) void audio_recordVolume(int channels, const uint16_t volume[]) { - if (!audio.audioDev || !audio.audioDev->record.volume) + if (!audio.audioDev || !audio.audioDev->record.volume || + !g_params.audioSyncVolume) return; // store the values so we can restore the state if the stream is restarted diff --git a/client/src/config.c b/client/src/config.c index 9f415165..bfc69c5a 100644 --- a/client/src/config.c +++ b/client/src/config.c @@ -517,6 +517,13 @@ static struct Option options[] = .type = OPTION_TYPE_BOOL, .value.x_bool = true }, + { + .module = "audio", + .name = "syncVolume", + .description = "Synchronize the volume level with the guest", + .type = OPTION_TYPE_BOOL, + .value.x_bool = true + }, {0} }; @@ -710,6 +717,7 @@ bool config_load(int argc, char * argv[]) g_params.audioPeriodSize = option_get_int("audio", "periodSize"); g_params.audioBufferLatency = option_get_int("audio", "bufferLatency"); g_params.micShowIndicator = option_get_bool("audio", "micShowIndicator"); + g_params.audioSyncVolume = option_get_bool("audio", "syncVolume"); return true; } diff --git a/client/src/main.h b/client/src/main.h index 610e43df..828a635d 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -221,6 +221,7 @@ struct AppParams int audioBufferLatency; bool micShowIndicator; enum MicDefaultState micDefaultState; + bool audioSyncVolume; }; struct CBRequest