[FFmpeg-devel] Trouble with GSM audio.

Artem Korneev tema
Tue Oct 2 23:33:04 CEST 2007

Last weeks I spent in attempting to decode audio frames from GSM format 
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?

More information about the ffmpeg-devel mailing list