Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

convert MP3 to Wave File?

Posted on 2003-02-19
8
Medium Priority
?
305 Views
Last Modified: 2010-04-04
Who can give me a component to convert mp3 to wav file or give me source code!

thanks.
0
Comment
Question by:DavidZhou
  • 6
  • 2
8 Comments
 

Author Comment

by:DavidZhou
ID: 8005895
Please Help
0
 
LVL 1

Accepted Solution

by:
Dissaster earned 400 total points
ID: 8045556
Check the XAudio Dll, it has a component interface for delphi, and can do what you want. Here´s the code i used, the instance for the XAudio component is named Decoder.

  lRAWFile := RawFileName(AudioFile);
  Decoder.OutputModuleRegister('xa_dsound_output.dll');
  Decoder.SetPlayerEnvironmentInteger('OUTPUT.DIRECTSOUND.WINDOW', (Owner as TWinControl).Handle);
  Decoder.SetOutputChannels(1); //for mono, 2 for stereo
  Decoder.SetPlayerMode(XA_PLAYER_MODE_OUTPUT_AUTO_CLOSE_ON_EOF);
  Decoder.SetOutputName(lRAWFile);
  Decoder.InputOpen(MP3File);
  Decoder.Play;

You'll know when it ended decoding the file in the OnDecoderNotifyOutputState event of the decoder, if the State is XA_OUTPUT_STATE_CLOSED then it´s finished.

  procedure MyForm.DecoderNotifyOutputState(Sender : TXaudioPlayer; State : integer);
  begin
    if State = XA_OUTPUT_STATE_CLOSED then
    begin
      //Do something here
    end;
  end;
0
 
LVL 1

Expert Comment

by:Dissaster
ID: 8045559
An error with the code above, the next line is not necesary, it was part of the proyect I used the decoder in:

lRAWFile := RawFileName(AudioFile);
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:DavidZhou
ID: 8051182
thanks,but where can i get the xaudio SDK, i can't find the download URL in http://www.xaudio.com/ 
0
 

Author Comment

by:DavidZhou
ID: 8085233
thanks. i have down it
0
 

Author Comment

by:DavidZhou
ID: 8085280
thanks. i have down it
0
 

Author Comment

by:DavidZhou
ID: 8085347
thanks. i have down it
0
 

Author Comment

by:DavidZhou
ID: 8085586
thank you very much
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

564 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