views:

631

answers:

2

Hello,

is there any way to convert all type of audio files into MP3 format. in my website... i have one control which plays MP3 files[audio]. but i have to provide facility to upload any kind of audio file[as i am developing audio gallary] and play it in my website..

if there is better solution to upload and play audio files in the website developed using asp.net 3.5 then also please reply.

+5  A: 
  1. You can either use LAME to run outside of your application (a very good compressor), for which an example is here. This will work very well, but you might get problems with it on a webserver. It would be best to host a service for this action, and have the page post items to a queue.

  2. Or you can use one of the many libraries that already exist, like this one for example. This still runs LAME, but it uses the DLL instead.

Codesleuth
+1 for considering using a message queue if you need to consider scalability in the future.
Jason Roberts
hi Codesleuth thanks for help... but does LAME converts Midi files into mp3 formats?? coz have converted wmv, wave files into mpe using ffmpeg as i am using same for video conversion also... the example for which you provide me link, show only how to convert wav into mp3 format... but i need to support .midi, .mpeg, .wav, .mp4 and .mp3 files in my site. so can you suggest me any resource to convert midi file into mp3 format using c#?
Radhi
Since MIDI files are records of scores and not audio, you will need to use a renderer. There's another question on S.O. about it (with a solution) here: http://stackoverflow.com/questions/1185392/how-to-convert-midi-to-wav-mp3-in-cRemember that not all audio files contain PCM or compressed PCM data - you will need to perform a lot of legwork to get "all types" of audio files as mp3.
Codesleuth
A: 

Please try this code http://alvas.net/alvas.audio,tips.aspx#tip24

ava