diff options
Diffstat (limited to '')
-rw-r--r-- | src/pcm_utils.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pcm_utils.h b/src/pcm_utils.h index 069fb9f53..71398c015 100644 --- a/src/pcm_utils.h +++ b/src/pcm_utils.h @@ -27,6 +27,11 @@ struct audio_format; +enum { + /** this value means "100% volume" */ + PCM_VOLUME_1 = 1000, +}; + struct pcm_convert_state { struct pcm_resample_state resample; @@ -43,7 +48,7 @@ struct pcm_convert_state { static inline int pcm_float_to_volume(float volume) { - return volume * 1000.0 + 0.5; + return volume * PCM_VOLUME_1 + 0.5; } void pcm_volume(char *buffer, int bufferSize, |