1 // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 #include "AudioDecoder.h"
20 # include "gnashconfig.h"
22 #include <speex/speex.h>
24 #ifdef RESAMPLING_SPEEX
25 # include <speex/speex_resampler.h>
28 #ifndef GNASH_MEDIA_DECODER_SPEEX
29 #define GNASH_MEDIA_DECODER_SPEEX
34 /// Audio decoder for the speex codec
36 /// This class will use the speex resampler if available
38 class AudioDecoderSpeex
: public AudioDecoder
44 boost::uint8_t* decode(const EncodedAudioFrame
& input
,
45 boost::uint32_t& outputSize
);
49 SpeexBits _speex_bits
;
50 void* _speex_dec_state
;
53 #ifdef RESAMPLING_SPEEX
54 SpeexResamplerState
* _resampler
;
55 /// Number of samples in a resampled 44kHz stereo frame.
56 boost::uint32_t _target_frame_size
;
63 #endif // GNASH_MEDIA_DECODER_SPEEX