aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_volume.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-21 18:14:20 +0100
committerMax Kellermann <max@duempel.org>2009-02-21 18:14:20 +0100
commitf0554d9a75abab093fe5169bdab6b6b75ae4f97a (patch)
tree041e132660e2c6ea0865306d19d7a45314e0a7a8 /src/pcm_volume.h
parentcae7c160a3084acf9e68845b16bae34772d18e4e (diff)
downloadmpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.tar.gz
mpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.tar.xz
mpd-f0554d9a75abab093fe5169bdab6b6b75ae4f97a.zip
pcm: added API documentation
Diffstat (limited to 'src/pcm_volume.h')
-rw-r--r--src/pcm_volume.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/pcm_volume.h b/src/pcm_volume.h
index 44ced88af..1b5e7fb0e 100644
--- a/src/pcm_volume.h
+++ b/src/pcm_volume.h
@@ -40,6 +40,10 @@ pcm_float_to_volume(float volume)
return volume * PCM_VOLUME_1 + 0.5;
}
+/**
+ * Returns the next volume dithering number, between -511 and +511.
+ * This number is taken from a global PRNG, see pcm_prng().
+ */
static inline int
pcm_volume_dither(void)
{
@@ -51,8 +55,16 @@ pcm_volume_dither(void)
return (r & 511) - ((r >> 9) & 511);
}
+/**
+ * Adjust the volume of the specified PCM buffer.
+ *
+ * @param buffer the PCM buffer
+ * @param length the length of the PCM buffer
+ * @param format the audio format of the PCM buffer
+ * @param volume the volume between 0 and #PCM_VOLUME_1
+ */
void
-pcm_volume(void *buffer, int bufferSize,
+pcm_volume(void *buffer, int length,
const struct audio_format *format,
int volume);