install-man1 doesn't need to depend on EXTRAMANPAGES
[gnash.git] / libmedia / AudioResampler.h
blob22b5e16f9d97ca8d97ac345237f3af7d976e5650
1 // AudioResampler.h -- custom audio resampler
2 //
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc
5 //
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.
10 //
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.
15 //
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
26 namespace gnash {
27 namespace media {
30 /// VERY crude audio resampler
31 class AudioResampler {
33 public:
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.
43 ///
44 /// @param adjusted_size
45 /// The size of the converted data (output) in bytes.
46 ///
47 /// @param data
48 /// Data that needs to be converted (input).
49 ///
50 /// @param sample_count
51 /// The datas current sample count (input).
52 ///
53 /// @param sample_size
54 /// The datas current sample size (input) in bytes.
55 ///
56 /// @param sample_rate
57 /// The datas current sample rate (input).
58 ///
59 /// @param stereo
60 /// Whether the current data is in stereo (input).
61 ///
62 /// @param m_sample_rate
63 /// The samplerate we which to convert to (output).
64 ///
65 /// @param m_stereo
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);
73 } // namespace media
74 } // namespace gnash
76 #endif // __GNASH_UTIL_H
79 // Local Variables:
80 // mode: C++
81 // c-basic-offset: 8
82 // tab-width: 8
83 // indent-tabs-mode: t
84 // End: