Link to home
Start Free TrialLog in
Avatar of WxW
WxW

asked on

G 723

Does anyone know where I can find a SDK for G 723 compression for my own application ?
Thanks =)
Avatar of BudVVeezer
BudVVeezer

maybe Wotist's page?   www.wotsits.org
 That has damn near everything..  =o)

~Aaron
Avatar of WxW

ASKER

Actually I am trying to figure why this code won't work

WAVEFORMATEX wINEX;
WAVEFORMATEX* wO = (WAVEFORMATEX*)&wINEX;
      wO->wFormatTag = WAVE_FORMAT_G723_ADPCM;
      wO->nChannels = 1;
      wO->nSamplesPerSec = 11025;
      wO->nBlockAlign = 48;
      wO->wBitsPerSample = 3;
      wO->cbSize = 4;
      wO->nAvgBytesPerSec = (wO->nSamplesPerSec * wO->nBlockAlign);


G723_ADPCMWAVEFORMAT wFF;
memcpy(&wFF.wfx,&wINEX,sizeof(WAVEFORMATEX));
wFF.cbExtraSize = 2;
wFF.nAuxBlockSize = 0;

waveInOpen(.....

then waveInOpen fails . Why ?
Did you check to see if the memcpy copied everything ok?  What does waveInOpen return?

~Aaron
Avatar of WxW

ASKER

waveInOpen returns 32
I have checked as well with no memcpy , directly to wFF ... neither work =(
::shrugs:: I'd love to help, but you are out of my league...those were just wild stabs..  I hope you get it to work though!!  I know how frustrating it is when it doesn't.  =o)  Good luck!

~Aaron
>then waveInOpen fails . Why ?

1. Do you have G 723 Codec installed?
2. waveInOpen is one of the low-level audio functions that may be lower than the Audio Compression Manager (ACM) level. If the hardware does not support G 723, it won't work. In this case, use the high level MCI commands instead.
3. Are you sure the parameters are correct (nBlockAlign, nAvgBytesPerSec, ...)?
Avatar of WxW

ASKER

1.Yes
2.I will try to use it
3.I followed the MS recommendations about setting the values , but I am not sure for the value of nAvgBytesPerSec . I could not find a description anywhere =)
3. You may record such a G723 wave file using other utilities and view it in Hex mode so that you can make sure all the parameters are correct.
Avatar of WxW

ASKER

chensu , do you know if there is anywhere a sample.c demonstration for that wave types ?

I also had the problem for other wave types , I could never found relative information in either the MSDN or other internet resources . Why wave types are so badly documented =?

3.I found that Windows sound recorder can record in these formats , I wonder how can I find then the avgBytes/sec =
Avatar of WxW

ASKER

And btw chensu ...
do you have a trick so I know when the buffer I recorded is "empty" , or almost empty ( no voice ) ?

Avatar of WxW

ASKER

I saw that G 723 should take 1 KB/sec in sound recorded . I tried to set this value ( 1024 ) . Any value I set , it keeps returning 32 as the result value =)
>do you know if there is anywhere a sample.c demonstration for that wave types ?

No, I don't.

>I could never found relative information in either the MSDN or other internet resources .

Here is a useful document. It was in the MSDN Library. But I can't find it now.
http://www.wotsit.org/wmusic/wavecomp.zip

>do you have a trick so I know when the buffer I recorded is "empty" , or almost empty ( no voice ) ?

If it is of PCM format, you may determine it simply by the volume. If the volume exceeds a threshold predefined by you, you may consider it empty.
Avatar of WxW

ASKER

Ok chensu , thanks . Please answer this question .

Btw do you know how to perform this volume check , and if it works with ADPCM or G 723 ?
>Btw do you know how to perform this volume check , and if it works with ADPCM or G 723 ?

Since you are using the low-level audio functions, you have the waveform buffer. That is the data you need to analyze. If it is of PCM format, the data itself is the volume. Look into the PCM format specification. If it is of ADPCM or G723, you may have to decompress it to PCM format first.

>Please answer this question .

Have you solved your problem? Did I answer your question? You may delete this question if not.
Avatar of WxW

ASKER

chensu , I 've seen applications like the Windows Sound Recorder , that have a graph that shows the volume of the sample . The graph is ---------------------------- if there is no sound . This should not be too hard to find out , do you know how ? Is there a DLL or OCX to give the info automatically ?

Anyway , all your comments are good thats why I told you to answer . As far for the file wavecomp.zip , it is under search.microsoft.com if you search for "New Wave Types" , but Windows will simply reject my attempt to use 723 =(
Go to
http://premium.microsoft.com/msdn/library/sdkdoc/multimed/wave_5s1f.htm
and read the section "PCM Waveform-Audio Data Format".

The so-called "Midpoint value" produces silence. So, let's take 16-bit PCM as an example. You may consider it is empty if the value is around 0 (maybe -100 to +100, up to you).
Avatar of WxW

ASKER

Thanks , that helped me very much to decide which buffer should be thrown away .

Only one more question ( I increated to 50 ) :

Since I don't know why the ADPCM won't work with transfers ( although I use the *same* function as in another program that works ) , and also neither G723 nor MPEG compression , do I have a chance to compress the buffer I get from PCM in real time ? Should I embedd the algorithms , or there is a DLL control that does that ?

ThankX again =)


You may use the Audio Compression Manager functions to compress the PCM buffer.

http://premium.microsoft.com/msdn/library/sdkdoc/multimed/audcomp_3kc2.htm
I happened to find the following KB article which might be helpful for you.

How To Use GSM Compression in Low-level Wave Recording
http://support.microsoft.com/support/kb/articles/q153/8/66.asp

So what I said ("waveInOpen is one of the low-level audio functions that may be lower than the Audio Compression Manager (ACM) level. If the hardware does not support G 723, it won't work. In this case, use the high level MCI commands instead.
") seems to be wrong.

Did you call waveInOpen() with the WAVE_MAPPER option?
Avatar of WxW

ASKER

Yes I call waveInOpen with WAVE_MAPPER
This ACM will help me a lot chensu , and I thank you very much for you help . Please answer .
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One more article in which you may be interested:

Using CODECs to Compress Wave Audio
http://premium.microsoft.com/msdn/library/techart/msdn_codec.htm