Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Audio compression.

Posted on 2004-05-01
12
Medium Priority
?
402 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 400 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
Technology Partners: 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

722 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