1 // AudioResampler.h -- custom audio resampler
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __GNASH_UTIL_H
22 #define __GNASH_UTIL_H
24 #include <boost/cstdint.hpp> // for boost::int16_t
30 /// VERY crude audio resampler
31 class AudioResampler
{
35 /// VERY crude sample-rate and stereo conversion.
37 /// Converts input data to output format.
39 /// @param adjusted_data
40 /// Where the converted data is placed (output). WARNING: even though
41 /// the type of the output data is int16, the adjusted_size output
42 /// parameter is in bytes.
44 /// @param adjusted_size
45 /// The size of the converted data (output) in bytes.
48 /// Data that needs to be converted (input).
50 /// @param sample_count
51 /// The datas current sample count (input).
53 /// @param sample_size
54 /// The datas current sample size (input) in bytes.
56 /// @param sample_rate
57 /// The datas current sample rate (input).
60 /// Whether the current data is in stereo (input).
62 /// @param m_sample_rate
63 /// The samplerate we which to convert to (output).
66 /// Do we want the output data to be in stereo (output)?
67 static void convert_raw_data(boost::int16_t** adjusted_data
,
68 int* adjusted_size
, void* data
, int sample_count
,
69 int sample_size
, int sample_rate
, bool stereo
,
70 int m_sample_rate
, bool m_stereo
);
76 #endif // __GNASH_UTIL_H
83 // indent-tabs-mode: t