Solved

Audio compression.

Posted on 2004-05-01
12
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
is twain_32.dll cmpatible with windows 10 ? 10 278
I could not build boost code, 10 117
Header Errors LNK2019, LNK1120 - Unresolved Externals 4 324
FMX TCameraComponent Problem 2 106
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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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.

752 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