Re: GSM <-> PCM converter
- From: Galian <galicia.developmentgroup@xxxxxxxxx>
- Date: 23 May 2007 23:19:04 -0700
alanglloyd@xxxxxxx :
On May 22, 5:02?pm, Galian <galicia.developmentgr...@xxxxxxxxx> wrote:
Hi all. I need some help with GSM-PCM converter implementation.<snip>
This is my code, all ACM functions return MMSYSERR_NOERROR, but data,
that I receive from destination buffer is wrong ( I hear in earphone
only comfort noise, and some sibilant ).It's application under Windows
Mobile 5.0. I don't know what's wrong. If some body can help me, it
will be excellent.
I don't do Windows Mobile or C but apart from thr buffer sizes it
looks OK to me. I presume that the conversion code is called multiple
times in a loop. As so there is no need to Prepare & UnPrepare the
header for each converted frame. Unles you are increasing the
specified memory you can use the same Prepared header throught.
Your buffer sizing appears correct, but while you've got the correct
relationship, the calculation appears "magical". Basically 320 samples
of PCM convert to 1 block of GSM. PCM (Mono 16 bits/sample) uses 2
bytes per block (sample). GSM uses 65 bytes / block. So 640 PCM bytes
convert to 65 bytes of GSM.
So the calculations are ...
GSMBytesPerBuffer = GSMBytesPerGSMBlock * GSMBlocksPerBuffer
(I thinkPreferredFramesPerPacket are GSMBlocksPerBuffer)
260 = 65 * 4
PCMBytesPerBuffer = PCMBytesPerPCMBlock * PCMBlocksPerGSMBlock *
GSMBlocksPerBuffer
(I think PCMBlocksPerGSMBlock are PCMSamplesPerGSMBlock)
2560 = 2 * 320 * 4
... or 130 and 1280 with only 2 GSMBlocksPerBuffer.
Alan Lloyd
Hi Alan!
Thank you for your answer.
I already found an error, It was ( as usually ) small logical error,
which I doesn't seen.
About calculating buffer sizes:
if I right understand two GSM frames, haves a size 65 bytes ( 32,5
bytes - one GSM frame )
So, for 4 PCM frames buffer size = 320 * 4 = 1280 bytes
and for 4 GSM frames buffer size = 65 * ( 4 / 2 ) = 130 bytes
I thing you missed " / 2 " in my code for calculating GSM buffer size
Thank you again for focus attention.
.
- Follow-Ups:
- Re: GSM <-> PCM converter
- From: alanglloyd@xxxxxxx
- Re: GSM <-> PCM converter
- References:
- GSM <-> PCM converter
- From: Galian
- Re: GSM <-> PCM converter
- From: alanglloyd@xxxxxxx
- GSM <-> PCM converter
- Prev by Date: Re: GSM <-> PCM converter
- Next by Date: Re: GSM <-> PCM converter
- Previous by thread: Re: GSM <-> PCM converter
- Next by thread: Re: GSM <-> PCM converter
- Index(es):
Relevant Pages
|