2 * Copyright (C) 2003-2010 The Music Player Daemon Project
3 * http://www.musicpd.org
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "audio_format.h"
32 * Converts PCM samples to 16 bit. If the source format is 24 bit,
33 * then dithering is applied.
35 * @param buffer a pcm_buffer object
36 * @param dither a pcm_dither object for 24-to-16 conversion
37 * @param bits the number of in the source buffer
38 * @param src the source PCM buffer
39 * @param src_size the size of #src in bytes
40 * @param dest_size_r returns the number of bytes of the destination buffer
41 * @return the destination buffer
44 pcm_convert_to_16(struct pcm_buffer
*buffer
, struct pcm_dither
*dither
,
45 enum sample_format src_format
, const void *src
,
46 size_t src_size
, size_t *dest_size_r
);
49 * Converts PCM samples to 24 bit (32 bit alignment).
51 * @param buffer a pcm_buffer object
52 * @param bits the number of in the source buffer
53 * @param src the source PCM buffer
54 * @param src_size the size of #src in bytes
55 * @param dest_size_r returns the number of bytes of the destination buffer
56 * @return the destination buffer
59 pcm_convert_to_24(struct pcm_buffer
*buffer
,
60 enum sample_format src_format
, const void *src
,
61 size_t src_size
, size_t *dest_size_r
);
64 * Converts PCM samples to 32 bit.
66 * @param buffer a pcm_buffer object
67 * @param bits the number of in the source buffer
68 * @param src the source PCM buffer
69 * @param src_size the size of #src in bytes
70 * @param dest_size_r returns the number of bytes of the destination buffer
71 * @return the destination buffer
74 pcm_convert_to_32(struct pcm_buffer
*buffer
,
75 enum sample_format src_format
, const void *src
,
76 size_t src_size
, size_t *dest_size_r
);