[FFmpeg-devel] Trouble with GSM audio.

Michel Bardiaux mbardiaux
Tue Oct 2 15:40:27 CEST 2007


Artem Korneev a ?crit :
> Last weeks I spent in attempting to decode audio frames from GSM format 

There aint no such animal. You probably mean GSM *codec*, in a wav, right?

> to PCM. But I still have no solution. :(
> 
> I've initialize codec context by these lines:
> 
>     inCtx->bit_rate       = 13000;
>     inCtx->sample_rate    = 8000;
>     inCtx->channels       = 1;
> 
> and after that, decode buffer with GSM audio by this code:
> 
>     while ( in_size > 0 ) {
>         outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
>         decoded_len = avcodec_decode_audio2(inCtx, samples_ptr, 
> &outbuf_size, inbuf_ptr, in_size);
> 
>         in_size     -= decoded_len;
>         inbuf_ptr   += decoded_len;
>         samples_ptr += outbuf_size;
>     }
> 
> ..and only noise I have as result. :( Does anybody have a workable 
> example of code for decoding GSM?

Yes: ffmpeg.c!

Please try ffmpeg -i on your input.

Chances are, its not GSM but GSM-MS. Is the codec_id right?

-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/




More information about the ffmpeg-devel mailing list