Solved

Audio compression.

Posted on 2004-05-01
12
383 Views
Last Modified: 2007-12-19
Hi.
I am recording voice with waveInWrite() in PCM format. I want to compress it. I tried to compress with ACM but it works with few formats, gives low compression and bad quality. Can someone suggest me what to do? May be I should find some other codecs to work with ACM or may be there is something else besides ACM?
0
Comment
Question by:Buffon
12 Comments
 
LVL 22

Expert Comment

by:grg99
ID: 10968182
You need to carefully make a request to get a better codec loaded.
See the code at msdn about how to use ICOpen().



0
 
LVL 1

Accepted Solution

by:
instruo earned 100 total points
ID: 10968568
Speex is the best codec I've found.  try these links (though the first one was down when I tried...  probably just temporary)

www.speex.org
http://www.republika.pl/roed/speexw/
0
 
LVL 3

Expert Comment

by:RJSoft
ID: 11028375
Your not considering Ogg Vorbis or Mp3?

RJ
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 11

Author Comment

by:Buffon
ID: 11028961
Mpeg Layer 3 I cannot record with waveInWrite, Ogg Vorbis I still didnt tried.
0
 
LVL 3

Expert Comment

by:RJSoft
ID: 11030470
Well actually you can record with waveInWrite but then transform your pcm wave buffer to mp3 with lame. You use lame to transform the data buffer you record to an mp3 format.

Me I have not done it that way yet as it was easier to save the buffer as a wav file and then use lame.exe to convert it to mp3. I simply call ShellExecute to lame.exe with parametors. "open","lame.exe","xxx.wav"...

But the user is left with a largish wav file.

I have seen some links to the lame.dll and I believe the whole source code is out there for lame to create your own dll. So you could concievably modify the dll code to accept your wave buffer and translate it. (Modifying the file reading function of lame and set the stream to an input handle to your buffer).

I dont believe you can get much support from lame developer I think he dropped the project.

Ogg Vorbis is supposed to be better. But it is not main stream.

RJ
0
 
LVL 11

Author Comment

by:Buffon
ID: 11030963
Can you tell me more about this "lame"? I am not familiar with it. Thanks.
0
 
LVL 3

Expert Comment

by:RJSoft
ID: 11033297
lame = lame aint mp3 encoder.

lame was created to encode wav files to mp3.

The lame.exe
http://www.trudyholler.com/pages/download_razorlame.html
The lame source
http://lame.sourceforge.net/

Do a search for mp3 lame for more info

RJ
0
 
LVL 3

Expert Comment

by:RJSoft
ID: 11259649
I dont understand your selection of an answer. The author of this question was obviously interested in using lame.

Is speex have better or equal compression as mp3 or Ogg? Or was your selection based on some other criteria? If so please explain.

RJ
0
 
LVL 11

Author Comment

by:Buffon
ID: 11262063
With speex I get a good enough quality and good compression. And I can compress PCM to speex with ACM.
To mp3 or Ogg I didnt succeed to convert. So the one who advised to me about speex gets the points.
0
 
LVL 3

Expert Comment

by:RJSoft
ID: 11262914
Buffon;

My apology. I thought the admin issued the points.

Out of curiosity, are you creating some kind of text to speech application or something similar?

I started to work on a text to speech application and got it to work using some of the libraries for Windows 98.

But I ran into problems trying to make one that worked on Windows 98 and XP. I could not get the XP version to work. Not sure if I had the correct libraries.

I never got arround to solving that one because some humongus download stopped me from going further. I believe I had the option of getting the CD from microsoft.

I cant exactly remember now cause it was a while back but I think it was the TTS sdk or something. I think I left off at trying to find the necessary files without downloading the whole thing.

Another thing related that I am having serious problem finding solution to is my wave editor program.

Using waveOut-waveIn low level api, I am able to record, save, pause, stop, add effects (reverb, echo, chorus, volume and, pitch) play a wav file. But after I save the file I would like to be able to edit the file.

So I need to be able to obtain a handle to the buffer and display it graphically. I need some kind of indicator of the current position when the wav file is playing. So that I can stop at that position and modify that area of the buffer.

I sorta got the graphical representation of the wav file. I found some link to another info site where the author speaks of a type of file that he creates a smaller representation of the wave file info by averaging. But it was not really a wav editor app it was just an explanation of how to represent a wav graphically.

The main problem is I do not know how to obtain current position using the waveIn or waveOut functions. I have been wondering if I should do this with mciSendString ??

Anyway if you have any ideals what I am talking about let me know.
If not my apologies.

Thanks
RJ
0
 
LVL 11

Author Comment

by:Buffon
ID: 11267999
No problem at all. I am sorry, I am not working on text to speech, but on VoIP. Good luck anyway.
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

770 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