Solved

G 723

Posted on 1998-12-15
23
194 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
ID: 1417272
maybe Wotist's page?   www.wotsits.org
 That has damn near everything..  =o)

~Aaron
0
 
LVL 6

Author Comment

by:WxW
ID: 1417273
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
ID: 1417274
Did you check to see if the memcpy copied everything ok?  What does waveInOpen return?

~Aaron
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 6

Author Comment

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

Expert Comment

by:BudVVeezer
ID: 1417276
::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
ID: 1417277
>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
ID: 1417278
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
ID: 1417279
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
ID: 1417280
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
ID: 1417281
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
ID: 1417282
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
 
LVL 23

Expert Comment

by:chensu
ID: 1417283
>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
ID: 1417284
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
ID: 1417285
>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
ID: 1417286
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
ID: 1417287
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
ID: 1417288
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
ID: 1417289
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
ID: 1417290
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
ID: 1417291
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
ID: 1417292
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
ID: 1417293
Thank you.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1417294
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Fox Pro commands 15 45
File Watcher and Deleter with Email notification 5 94
ClickOnce Install - Shortcut Question 3 88
Question to Pivot table 1 51
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

816 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

12 Experts available now in Live!

Get 1:1 Help Now