• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 220
  • Last Modified:

G 723

Does anyone know where I can find a SDK for G 723 compression for my own application ?
Thanks =)
0
WxW
Asked:
WxW
  • 10
  • 10
  • 3
1 Solution
 
BudVVeezerCommented:
maybe Wotist's page?   www.wotsits.org
 That has damn near everything..  =o)

~Aaron
0
 
WxWAuthor Commented:
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 ?
0
 
BudVVeezerCommented:
Did you check to see if the memcpy copied everything ok?  What does waveInOpen return?

~Aaron
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
WxWAuthor Commented:
waveInOpen returns 32
I have checked as well with no memcpy , directly to wFF ... neither work =(
0
 
BudVVeezerCommented:
::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
0
 
chensuCommented:
>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, ...)?
0
 
WxWAuthor Commented:
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 =)
0
 
chensuCommented:
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.
0
 
WxWAuthor Commented:
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 =
0
 
WxWAuthor Commented:
And btw chensu ...
do you have a trick so I know when the buffer I recorded is "empty" , or almost empty ( no voice ) ?

0
 
WxWAuthor Commented:
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 =)
0
 
chensuCommented:
>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.
0
 
WxWAuthor Commented:
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 ?
0
 
chensuCommented:
>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.
0
 
WxWAuthor Commented:
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 =(
0
 
chensuCommented:
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).
0
 
WxWAuthor Commented:
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 =)


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

http://premium.microsoft.com/msdn/library/sdkdoc/multimed/audcomp_3kc2.htm
0
 
chensuCommented:
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?
0
 
chensuCommented:
SAMPLE: Direct-to-Disk Recorder with ACM
http://support.microsoft.com/support/kb/articles/q116/2/93.asp
0
 
WxWAuthor Commented:
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 .
0
 
chensuCommented:
Thank you.
0
 
chensuCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 10
  • 10
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now