views:

27

answers:

2

Converting MIDI byte array to MP3 byte array


Does someone know how to convert a MIDI file (average playback time of 30 seconds) which is represented in a byte array to an MP3 byte array.

So ideally i need to have a C# function which accepts a MIDI byte array and returns a MP3 byte array.

The conversion should not take more than 2 - 3 seconds.

Are there any frameworks / tools / 3rd party DLLs to perform this easily ?

Please let me know.

Thanks, Vijay

+2  A: 

MIDI file is not audio, it is audio instructions. This has to be "rendered/played" to audio (using various MIDI players depending on the capability of your sound card) and then compressed to MP3.

I do not know a DLL that can do all of that. Lame MP3 DLL is a free open source DLL that can do the compression for you.

http://lame.sourceforge.net/

Aliostad
Thanks Aliostad.
vijaysylvester
+1  A: 

Over at CodeProject there's a C# MIDI Toolkit which could help you. You'll probably have write the code to record the output stream yourself though.

herzmeister der welten
Thanks herzmeister der welten
vijaysylvester