volume.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. #ifndef foovolumehfoo
  2. #define foovolumehfoo
  3. /***
  4. This file is part of PulseAudio.
  5. Copyright 2004-2006 Lennart Poettering
  6. Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
  7. PulseAudio is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU Lesser General Public License as published
  9. by the Free Software Foundation; either version 2.1 of the License,
  10. or (at your option) any later version.
  11. PulseAudio is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public License
  16. along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
  17. ***/
  18. #include <inttypes.h>
  19. #include <limits.h>
  20. #include <pulse/cdecl.h>
  21. #include <pulse/gccmacro.h>
  22. #include <pulse/sample.h>
  23. #include <pulse/channelmap.h>
  24. #include <pulse/version.h>
  25. /** \page volume Volume Control
  26. *
  27. * \section overv_sec Overview
  28. *
  29. * Sinks, sources, sink inputs and samples can all have their own volumes.
  30. * To deal with these, The PulseAudio library contains a number of functions
  31. * that ease handling.
  32. *
  33. * The basic volume type in PulseAudio is the \ref pa_volume_t type. Most of
  34. * the time, applications will use the aggregated pa_cvolume structure that
  35. * can store the volume of all channels at once.
  36. *
  37. * Volumes commonly span between muted (0%), and normal (100%). It is possible
  38. * to set volumes to higher than 100%, but clipping might occur.
  39. *
  40. * There is no single well-defined meaning attached to the 100% volume for a
  41. * sink input. In fact, it depends on the server configuration. With flat
  42. * volumes enabled (the default in most Linux distributions), it means the
  43. * maximum volume that the sound hardware is capable of, which is usually so
  44. * high that you absolutely must not set sink input volume to 100% unless the
  45. * the user explicitly requests that (note that usually you shouldn't set the
  46. * volume anyway if the user doesn't explicitly request it, instead, let
  47. * PulseAudio decide the volume for the sink input). With flat volumes disabled
  48. * (the default in Ubuntu), the sink input volume is relative to the sink
  49. * volume, so 100% sink input volume means that the sink input is played at the
  50. * current sink volume level. In this case 100% is often a good default volume
  51. * for a sink input, although you still should let PulseAudio decide the
  52. * default volume. It is possible to figure out whether flat volume mode is in
  53. * effect for a given sink by calling pa_context_get_sink_info_by_name().
  54. *
  55. * \section calc_sec Calculations
  56. *
  57. * The volumes in PulseAudio are logarithmic in nature and applications
  58. * shouldn't perform calculations with them directly. Instead, they should
  59. * be converted to and from either dB or a linear scale:
  60. *
  61. * \li dB - pa_sw_volume_from_dB() / pa_sw_volume_to_dB()
  62. * \li Linear - pa_sw_volume_from_linear() / pa_sw_volume_to_linear()
  63. *
  64. * For simple multiplication, pa_sw_volume_multiply() and
  65. * pa_sw_cvolume_multiply() can be used.
  66. *
  67. * Calculations can only be reliably performed on software volumes
  68. * as it is commonly unknown what scale hardware volumes relate to.
  69. *
  70. * The functions described above are only valid when used with
  71. * software volumes. Hence it is usually a better idea to treat all
  72. * volume values as opaque with a range from PA_VOLUME_MUTED (0%) to
  73. * PA_VOLUME_NORM (100%) and to refrain from any calculations with
  74. * them.
  75. *
  76. * \section conv_sec Convenience Functions
  77. *
  78. * To handle the pa_cvolume structure, the PulseAudio library provides a
  79. * number of convenience functions:
  80. *
  81. * \li pa_cvolume_valid() - Tests if a pa_cvolume structure is valid.
  82. * \li pa_cvolume_equal() - Tests if two pa_cvolume structures are identical.
  83. * \li pa_cvolume_channels_equal_to() - Tests if all channels of a pa_cvolume
  84. * structure have a given volume.
  85. * \li pa_cvolume_is_muted() - Tests if all channels of a pa_cvolume
  86. * structure are muted.
  87. * \li pa_cvolume_is_norm() - Tests if all channels of a pa_cvolume structure
  88. * are at a normal volume.
  89. * \li pa_cvolume_set() - Set the first n channels of a pa_cvolume structure to
  90. * a certain volume.
  91. * \li pa_cvolume_reset() - Set the first n channels of a pa_cvolume structure
  92. * to a normal volume.
  93. * \li pa_cvolume_mute() - Set the first n channels of a pa_cvolume structure
  94. * to a muted volume.
  95. * \li pa_cvolume_avg() - Return the average volume of all channels.
  96. * \li pa_cvolume_snprint() - Pretty print a pa_cvolume structure.
  97. */
  98. /** \file
  99. * Constants and routines for volume handling
  100. *
  101. * See also \subpage volume
  102. */
  103. PA_C_DECL_BEGIN
  104. /** Volume specification:
  105. * PA_VOLUME_MUTED: silence;
  106. * < PA_VOLUME_NORM: decreased volume;
  107. * PA_VOLUME_NORM: normal volume;
  108. * > PA_VOLUME_NORM: increased volume */
  109. typedef uint32_t pa_volume_t;
  110. /** Normal volume (100%, 0 dB) */
  111. #define PA_VOLUME_NORM ((pa_volume_t) 0x10000U)
  112. /** Muted (minimal valid) volume (0%, -inf dB) */
  113. #define PA_VOLUME_MUTED ((pa_volume_t) 0U)
  114. /** Maximum valid volume we can store. \since 0.9.15 */
  115. #define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX/2)
  116. /** Recommended maximum volume to show in user facing UIs.
  117. * Note: UIs should deal gracefully with volumes greater than this value
  118. * and not cause feedback loops etc. - i.e. if the volume is more than
  119. * this, the UI should not limit it and push the limited value back to
  120. * the server. \since 0.9.23 */
  121. #define PA_VOLUME_UI_MAX (pa_sw_volume_from_dB(+11.0))
  122. /** Special 'invalid' volume. \since 0.9.16 */
  123. #define PA_VOLUME_INVALID ((pa_volume_t) UINT32_MAX)
  124. /** Check if volume is valid. \since 1.0 */
  125. #define PA_VOLUME_IS_VALID(v) ((v) <= PA_VOLUME_MAX)
  126. /** Clamp volume to the permitted range. \since 1.0 */
  127. #define PA_CLAMP_VOLUME(v) (PA_CLAMP_UNLIKELY((v), PA_VOLUME_MUTED, PA_VOLUME_MAX))
  128. /** A structure encapsulating a per-channel volume */
  129. typedef struct pa_cvolume {
  130. uint8_t channels; /**< Number of channels */
  131. pa_volume_t values[PA_CHANNELS_MAX]; /**< Per-channel volume */
  132. } pa_cvolume;
  133. /** Return non-zero when *a == *b */
  134. int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) PA_GCC_PURE;
  135. /** Initialize the specified volume and return a pointer to
  136. * it. The sample spec will have a defined state but
  137. * pa_cvolume_valid() will fail for it. \since 0.9.13 */
  138. pa_cvolume* pa_cvolume_init(pa_cvolume *a);
  139. /** Set the volume of the first n channels to PA_VOLUME_NORM */
  140. #define pa_cvolume_reset(a, n) pa_cvolume_set((a), (n), PA_VOLUME_NORM)
  141. /** Set the volume of the first n channels to PA_VOLUME_MUTED */
  142. #define pa_cvolume_mute(a, n) pa_cvolume_set((a), (n), PA_VOLUME_MUTED)
  143. /** Set the volume of the specified number of channels to the volume v */
  144. pa_cvolume* pa_cvolume_set(pa_cvolume *a, unsigned channels, pa_volume_t v);
  145. /** Maximum length of the strings returned by
  146. * pa_cvolume_snprint(). Please note that this value can change with
  147. * any release without warning and without being considered API or ABI
  148. * breakage. You should not use this definition anywhere where it
  149. * might become part of an ABI.*/
  150. #define PA_CVOLUME_SNPRINT_MAX 320
  151. /** Pretty print a volume structure */
  152. char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c);
  153. /** Maximum length of the strings returned by
  154. * pa_sw_cvolume_snprint_dB(). Please note that this value can change with
  155. * any release without warning and without being considered API or ABI
  156. * breakage. You should not use this definition anywhere where it
  157. * might become part of an ABI. \since 0.9.13 */
  158. #define PA_SW_CVOLUME_SNPRINT_DB_MAX 448
  159. /** Pretty print a volume structure but show dB values. \since 0.9.13 */
  160. char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c);
  161. /** Maximum length of the strings returned by pa_cvolume_snprint_verbose().
  162. * Please note that this value can change with any release without warning and
  163. * without being considered API or ABI breakage. You should not use this
  164. * definition anywhere where it might become part of an ABI. \since 5.0 */
  165. #define PA_CVOLUME_SNPRINT_VERBOSE_MAX 1984
  166. /** Pretty print a volume structure in a verbose way. The volume for each
  167. * channel is printed in several formats: the raw pa_volume_t value,
  168. * percentage, and if print_dB is non-zero, also the dB value. If map is not
  169. * NULL, the channel names will be printed. \since 5.0 */
  170. char *pa_cvolume_snprint_verbose(char *s, size_t l, const pa_cvolume *c, const pa_channel_map *map, int print_dB);
  171. /** Maximum length of the strings returned by
  172. * pa_volume_snprint(). Please note that this value can change with
  173. * any release without warning and without being considered API or ABI
  174. * breakage. You should not use this definition anywhere where it
  175. * might become part of an ABI. \since 0.9.15 */
  176. #define PA_VOLUME_SNPRINT_MAX 10
  177. /** Pretty print a volume \since 0.9.15 */
  178. char *pa_volume_snprint(char *s, size_t l, pa_volume_t v);
  179. /** Maximum length of the strings returned by
  180. * pa_sw_volume_snprint_dB(). Please note that this value can change with
  181. * any release without warning and without being considered API or ABI
  182. * breakage. You should not use this definition anywhere where it
  183. * might become part of an ABI. \since 0.9.15 */
  184. #define PA_SW_VOLUME_SNPRINT_DB_MAX 11
  185. /** Pretty print a volume but show dB values. \since 0.9.15 */
  186. char *pa_sw_volume_snprint_dB(char *s, size_t l, pa_volume_t v);
  187. /** Maximum length of the strings returned by pa_volume_snprint_verbose().
  188. * Please note that this value can change with any release without warning and
  189. * withou being considered API or ABI breakage. You should not use this
  190. * definition anywhere where it might become part of an ABI. \since 5.0 */
  191. #define PA_VOLUME_SNPRINT_VERBOSE_MAX 35
  192. /** Pretty print a volume in a verbose way. The volume is printed in several
  193. * formats: the raw pa_volume_t value, percentage, and if print_dB is non-zero,
  194. * also the dB value. \since 5.0 */
  195. char *pa_volume_snprint_verbose(char *s, size_t l, pa_volume_t v, int print_dB);
  196. /** Return the average volume of all channels */
  197. pa_volume_t pa_cvolume_avg(const pa_cvolume *a) PA_GCC_PURE;
  198. /** Return the average volume of all channels that are included in the
  199. * specified channel map with the specified channel position mask. If
  200. * cm is NULL this call is identical to pa_cvolume_avg(). If no
  201. * channel is selected the returned value will be
  202. * PA_VOLUME_MUTED. \since 0.9.16 */
  203. pa_volume_t pa_cvolume_avg_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) PA_GCC_PURE;
  204. /** Return the maximum volume of all channels. \since 0.9.12 */
  205. pa_volume_t pa_cvolume_max(const pa_cvolume *a) PA_GCC_PURE;
  206. /** Return the maximum volume of all channels that are included in the
  207. * specified channel map with the specified channel position mask. If
  208. * cm is NULL this call is identical to pa_cvolume_max(). If no
  209. * channel is selected the returned value will be PA_VOLUME_MUTED.
  210. * \since 0.9.16 */
  211. pa_volume_t pa_cvolume_max_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) PA_GCC_PURE;
  212. /** Return the minimum volume of all channels. \since 0.9.16 */
  213. pa_volume_t pa_cvolume_min(const pa_cvolume *a) PA_GCC_PURE;
  214. /** Return the minimum volume of all channels that are included in the
  215. * specified channel map with the specified channel position mask. If
  216. * cm is NULL this call is identical to pa_cvolume_min(). If no
  217. * channel is selected the returned value will be PA_VOLUME_MUTED.
  218. * \since 0.9.16 */
  219. pa_volume_t pa_cvolume_min_mask(const pa_cvolume *a, const pa_channel_map *cm, pa_channel_position_mask_t mask) PA_GCC_PURE;
  220. /** Return non-zero when the passed cvolume structure is valid */
  221. int pa_cvolume_valid(const pa_cvolume *v) PA_GCC_PURE;
  222. /** Return non-zero if the volume of all channels is equal to the specified value */
  223. int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) PA_GCC_PURE;
  224. /** Return 1 if the specified volume has all channels muted */
  225. #define pa_cvolume_is_muted(a) pa_cvolume_channels_equal_to((a), PA_VOLUME_MUTED)
  226. /** Return 1 if the specified volume has all channels on normal level */
  227. #define pa_cvolume_is_norm(a) pa_cvolume_channels_equal_to((a), PA_VOLUME_NORM)
  228. /** Multiply two volume specifications, return the result. This uses
  229. * PA_VOLUME_NORM as neutral element of multiplication. This is only
  230. * valid for software volumes! */
  231. pa_volume_t pa_sw_volume_multiply(pa_volume_t a, pa_volume_t b) PA_GCC_CONST;
  232. /** Multiply two per-channel volumes and return the result in
  233. * *dest. This is only valid for software volumes! a, b and dest may
  234. * point to the same structure. */
  235. pa_cvolume *pa_sw_cvolume_multiply(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b);
  236. /** Multiply a per-channel volume with a scalar volume and return the
  237. * result in *dest. This is only valid for software volumes! a
  238. * and dest may point to the same structure. \since
  239. * 0.9.16 */
  240. pa_cvolume *pa_sw_cvolume_multiply_scalar(pa_cvolume *dest, const pa_cvolume *a, pa_volume_t b);
  241. /** Divide two volume specifications, return the result. This uses
  242. * PA_VOLUME_NORM as neutral element of division. This is only valid
  243. * for software volumes! If a division by zero is tried the result
  244. * will be 0. \since 0.9.13 */
  245. pa_volume_t pa_sw_volume_divide(pa_volume_t a, pa_volume_t b) PA_GCC_CONST;
  246. /** Divide two per-channel volumes and return the result in
  247. * *dest. This is only valid for software volumes! a, b
  248. * and dest may point to the same structure. \since 0.9.13 */
  249. pa_cvolume *pa_sw_cvolume_divide(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b);
  250. /** Divide a per-channel volume by a scalar volume and return the
  251. * result in *dest. This is only valid for software volumes! a
  252. * and dest may point to the same structure. \since
  253. * 0.9.16 */
  254. pa_cvolume *pa_sw_cvolume_divide_scalar(pa_cvolume *dest, const pa_cvolume *a, pa_volume_t b);
  255. /** Convert a decibel value to a volume (amplitude, not power). This is only valid for software volumes! */
  256. pa_volume_t pa_sw_volume_from_dB(double f) PA_GCC_CONST;
  257. /** Convert a volume to a decibel value (amplitude, not power). This is only valid for software volumes! */
  258. double pa_sw_volume_to_dB(pa_volume_t v) PA_GCC_CONST;
  259. /** Convert a linear factor to a volume. 0.0 and less is muted while
  260. * 1.0 is PA_VOLUME_NORM. This is only valid for software volumes! */
  261. pa_volume_t pa_sw_volume_from_linear(double v) PA_GCC_CONST;
  262. /** Convert a volume to a linear factor. This is only valid for software volumes! */
  263. double pa_sw_volume_to_linear(pa_volume_t v) PA_GCC_CONST;
  264. #ifdef INFINITY
  265. #define PA_DECIBEL_MININFTY ((double) -INFINITY)
  266. #else
  267. /** This floor value is used as minus infinity when using pa_sw_volume_to_dB() / pa_sw_volume_from_dB(). */
  268. #define PA_DECIBEL_MININFTY ((double) -200.0)
  269. #endif
  270. /** Remap a volume from one channel mapping to a different channel mapping. \since 0.9.12 */
  271. pa_cvolume *pa_cvolume_remap(pa_cvolume *v, const pa_channel_map *from, const pa_channel_map *to);
  272. /** Return non-zero if the specified volume is compatible with the
  273. * specified sample spec. \since 0.9.13 */
  274. int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) PA_GCC_PURE;
  275. /** Return non-zero if the specified volume is compatible with the
  276. * specified sample spec. \since 0.9.15 */
  277. int pa_cvolume_compatible_with_channel_map(const pa_cvolume *v, const pa_channel_map *cm) PA_GCC_PURE;
  278. /** Calculate a 'balance' value for the specified volume with the
  279. * specified channel map. The return value will range from -1.0f
  280. * (left) to +1.0f (right). If no balance value is applicable to this
  281. * channel map the return value will always be 0.0f. See
  282. * pa_channel_map_can_balance(). \since 0.9.15 */
  283. float pa_cvolume_get_balance(const pa_cvolume *v, const pa_channel_map *map) PA_GCC_PURE;
  284. /** Adjust the 'balance' value for the specified volume with the
  285. * specified channel map. v will be modified in place and
  286. * returned. The balance is a value between -1.0f and +1.0f. This
  287. * operation might not be reversible! Also, after this call
  288. * pa_cvolume_get_balance() is not guaranteed to actually return the
  289. * requested balance value (e.g. when the input volume was zero anyway for
  290. * all channels). If no balance value is applicable to
  291. * this channel map the volume will not be modified. See
  292. * pa_channel_map_can_balance(). \since 0.9.15 */
  293. pa_cvolume* pa_cvolume_set_balance(pa_cvolume *v, const pa_channel_map *map, float new_balance);
  294. /** Calculate a 'fade' value (i.e.\ 'balance' between front and rear)
  295. * for the specified volume with the specified channel map. The return
  296. * value will range from -1.0f (rear) to +1.0f (left). If no fade
  297. * value is applicable to this channel map the return value will
  298. * always be 0.0f. See pa_channel_map_can_fade(). \since 0.9.15 */
  299. float pa_cvolume_get_fade(const pa_cvolume *v, const pa_channel_map *map) PA_GCC_PURE;
  300. /** Adjust the 'fade' value (i.e.\ 'balance' between front and rear)
  301. * for the specified volume with the specified channel map. v will be
  302. * modified in place and returned. The balance is a value between
  303. * -1.0f and +1.0f. This operation might not be reversible! Also,
  304. * after this call pa_cvolume_get_fade() is not guaranteed to actually
  305. * return the requested fade value (e.g. when the input volume was
  306. * zero anyway for all channels). If no fade value is applicable to
  307. * this channel map the volume will not be modified. See
  308. * pa_channel_map_can_fade(). \since 0.9.15 */
  309. pa_cvolume* pa_cvolume_set_fade(pa_cvolume *v, const pa_channel_map *map, float new_fade);
  310. /** Calculate a 'lfe balance' value for the specified volume with
  311. * the specified channel map. The return value will range from
  312. * -1.0f (no lfe) to +1.0f (only lfe), where 0.0f is balanced.
  313. * If no value is applicable to this channel map the return value
  314. * will always be 0.0f. See pa_channel_map_can_lfe_balance(). \since 8.0 */
  315. float pa_cvolume_get_lfe_balance(const pa_cvolume *v, const pa_channel_map *map) PA_GCC_PURE;
  316. /** Adjust the 'lfe balance' value for the specified volume with
  317. * the specified channel map. v will be modified in place and returned.
  318. * The balance is a value between -1.0f (no lfe) and +1.0f (only lfe).
  319. * This operation might not be reversible! Also, after this call
  320. * pa_cvolume_get_lfe_balance() is not guaranteed to actually
  321. * return the requested value (e.g. when the input volume was
  322. * zero anyway for all channels). If no lfe balance value is applicable to
  323. * this channel map the volume will not be modified. See
  324. * pa_channel_map_can_lfe_balance(). \since 8.0 */
  325. pa_cvolume* pa_cvolume_set_lfe_balance(pa_cvolume *v, const pa_channel_map *map, float new_balance);
  326. /** Scale the passed pa_cvolume structure so that the maximum volume
  327. * of all channels equals max. The proportions between the channel
  328. * volumes are kept. \since 0.9.15 */
  329. pa_cvolume* pa_cvolume_scale(pa_cvolume *v, pa_volume_t max);
  330. /** Scale the passed pa_cvolume structure so that the maximum volume
  331. * of all channels selected via cm/mask equals max. This also modifies
  332. * the volume of those channels that are unmasked. The proportions
  333. * between the channel volumes are kept. \since 0.9.16 */
  334. pa_cvolume* pa_cvolume_scale_mask(pa_cvolume *v, pa_volume_t max, pa_channel_map *cm, pa_channel_position_mask_t mask);
  335. /** Set the passed volume to all channels at the specified channel
  336. * position. Will return the updated volume struct, or NULL if there
  337. * is no channel at the position specified. You can check if a channel
  338. * map includes a specific position by calling
  339. * pa_channel_map_has_position(). \since 0.9.16 */
  340. pa_cvolume* pa_cvolume_set_position(pa_cvolume *cv, const pa_channel_map *map, pa_channel_position_t t, pa_volume_t v);
  341. /** Get the maximum volume of all channels at the specified channel
  342. * position. Will return 0 if there is no channel at the position
  343. * specified. You can check if a channel map includes a specific
  344. * position by calling pa_channel_map_has_position(). \since 0.9.16 */
  345. pa_volume_t pa_cvolume_get_position(pa_cvolume *cv, const pa_channel_map *map, pa_channel_position_t t) PA_GCC_PURE;
  346. /** This goes through all channels in a and b and sets the
  347. * corresponding channel in dest to the greater volume of both. a, b
  348. * and dest may point to the same structure. \since 0.9.16 */
  349. pa_cvolume* pa_cvolume_merge(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b);
  350. /** Increase the volume passed in by 'inc', but not exceeding 'limit'.
  351. * The proportions between the channels are kept. \since 0.9.19 */
  352. pa_cvolume* pa_cvolume_inc_clamp(pa_cvolume *v, pa_volume_t inc, pa_volume_t limit);
  353. /** Increase the volume passed in by 'inc'. The proportions between
  354. * the channels are kept. \since 0.9.16 */
  355. pa_cvolume* pa_cvolume_inc(pa_cvolume *v, pa_volume_t inc);
  356. /** Decrease the volume passed in by 'dec'. The proportions between
  357. * the channels are kept. \since 0.9.16 */
  358. pa_cvolume* pa_cvolume_dec(pa_cvolume *v, pa_volume_t dec);
  359. PA_C_DECL_END
  360. #endif