Solved

Audio compression.

Posted on 2004-05-01
12
386 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

856 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