Solved

G 723

Posted on 1998-12-15
23
187 Views
Last Modified: 2013-12-03
Does anyone know where I can find a SDK for G 723 compression for my own application ?
Thanks =)
0
Comment
Question by:WxW
  • 10
  • 10
  • 3
23 Comments
 
LVL 3

Expert Comment

by:BudVVeezer
Comment Utility
maybe Wotist's page?   www.wotsits.org
 That has damn near everything..  =o)

~Aaron
0
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 3

Expert Comment

by:BudVVeezer
Comment Utility
Did you check to see if the memcpy copied everything ok?  What does waveInOpen return?

~Aaron
0
 
LVL 6

Author Comment

by:WxW
Comment Utility
waveInOpen returns 32
I have checked as well with no memcpy , directly to wFF ... neither work =(
0
 
LVL 3

Expert Comment

by:BudVVeezer
Comment Utility
::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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
>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
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 6

Author Comment

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

0
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 23

Expert Comment

by:chensu
Comment Utility
>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
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
>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
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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
 
LVL 23

Expert Comment

by:chensu
Comment Utility
SAMPLE: Direct-to-Disk Recorder with ACM
http://support.microsoft.com/support/kb/articles/q116/2/93.asp
0
 
LVL 6

Author Comment

by:WxW
Comment Utility
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
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
Comment Utility
Thank you.
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now