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 frame开发者_JAVA技巧works / tools / 3rd-party DLLs to perform this easily?
Please let me know.
Thanks, Vijay
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/
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.
精彩评论