Re: ACM Convert - acmStreamOpen return 512



On Apr 10, 2:26?pm, "esselte" <vincent....@xxxxxxxxx> wrote:
I have found that sometimes it takes two steps.
PCM / 44.1 KHz -> PCM / 8KKHz
and then
PCM / 8KHz -> X / 8KHz

Do I have to go this way

Yes

or it is possible to convert file from pcm to
gsm610 in one step?

Only if the sample rates are the same, otherwise - No

If it takes 2 steps, which is the second?

PCM to compressed or compressed to PCM _must_ be at the same sample
rate.

So going PCM to GSM at different sample rates

Step 1 PCM original rate to PCM at compressed rate
Step 2 PCM at compressed rate to compressed format

And going from GSM to PCM at different rates

Step 1 GSM to PCM at compressed rate
Step 2 PCM at compressed rate to PCM at final rate

But you don't need to get it to a file at the intermediate PCM format.
If you choose your buffer sizes appropriately you can (for PCM to
GSM)...

1 Fill PCM buffer A at original rate from file
2 Transform to PCM buffer B at compressed rate
3 Convert to GSM buffer C at compressed rate
4 Save to file as GSM
5 if not eof go to 1

Calculate the buffers (or use acm StreamSize) so that a full input
buffer transforms and converts to a full buffer all the way through.
That way you don't have to do "remainder shuffling" on each buffer.

Alan Lloyd





.



Relevant Pages

  • Re: Problem while converting back to PCM
    ... GSM works on multiples of 320 samples, or 640 bytes for 16-bit PCM. ... Your call to acmStreamPrepareHeader() specifies the INPUT buffer size ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: Problem while converting back to PCM
    ... Rather, if your posted code is correct, you are passing an incorrect buffer ... The decompression fails because this isn't a valid decompression frame size. ... >> format conversion from PCM to GSM and back. ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: Strange output from convertion PCM->GSM610
    ... "GSM chunk" Start with how many blocks of GSM you want in the GSM ... buffer - lets say 2. ... Lets say your PCM is 8000Hz mono 16bit, ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: Problem while converting back to PCM
    ... it for conversion say "500 bytes" buffer. ... > This is to convert FROM PCM into GSM 06.10 format. ... >> output buffer recieve while converting back to PCM. ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: Problem while converting back to PCM
    ... > format conversion from PCM to GSM and back. ... > PCM to GSM and then back to the PCM from the resultant GSM buffer. ...
    (microsoft.public.win32.programmer.mmedia)