2 // Copyright (C) 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc.
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 3 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
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "AudioDecoder.h"
22 # include "gnashconfig.h"
24 #include <speex/speex.h>
26 #ifdef RESAMPLING_SPEEX
27 # include <speex/speex_resampler.h>
30 #ifndef GNASH_MEDIA_DECODER_SPEEX
31 #define GNASH_MEDIA_DECODER_SPEEX
36 /// Audio decoder for the speex codec
38 /// This class will use the speex resampler if available
40 class AudioDecoderSpeex
: public AudioDecoder
46 boost::uint8_t* decode(const EncodedAudioFrame
& input
,
47 boost::uint32_t& outputSize
);
51 SpeexBits _speex_bits
;
52 void* _speex_dec_state
;
55 #ifdef RESAMPLING_SPEEX
56 SpeexResamplerState
* _resampler
;
57 /// Number of samples in a resampled 44kHz stereo frame.
58 boost::uint32_t _target_frame_size
;
65 #endif // GNASH_MEDIA_DECODER_SPEEX