-- MP3Xtra v0.5 (c) 2014 Valentin Schmidt -- contact: fluxus@freenet.de *************************************************************** INSTALLATION *************************************************************** MP3Xtra is a scripting xtra for director (win) that can be used to convert internal sound members or external WAV files to MP3 files. It's based on the free MP3 Encoder LAME (or alternatively BladeEnc) and depends on an external encoder-DLL, either "lame_enc.dll" (default, distributed with xtra) or "BladeEnc.dll". The mem2mp3 method also requires the two xtras 'Mix Services.x32' and 'Sound Import Export.x32'. *************************************************************** METHOD OVERVIEW ([...] = optional parameters, can be omitted) *************************************************************** --------------------------------------------------------------- xtra("MP3Xtra").new([dllFile]) --------------------------------------------------------------- Description: ============ Creates new xtra instance. The optional parameter dllFile specifies the (path and) name of the encoder-DLL. If only the filename is specified without a path, the DLL must be in the system path or in the same folder as director.exe (authoring mode) or the projector (runtime mode). If the parameter is omitted, the xtra tries to load "lame_enc.dll". Example usage: ============== mp3 = xtra("MP3Xtra").new() mp3 = xtra("MP3Xtra").new(_player.applicationPath&"xtras\lame_enc.dll") --------------------------------------------------------------- wav2mp3 (object me, string inputFile, string outputFile, integer bitRate) -> bool OK --------------------------------------------------------------- Description: ============ Converts the input WAV file 'inputFile' to MP3 file 'outputFile' with specified bitRate (between 8 and 350(?)). Example usage: ============== ok = mp3Xtra.wav2mp3(_movie.path&"test.wav", _movie.path&"test.mp3", 128) --------------------------------------------------------------- mem2mp3 (object me, object soundMem, string outputFile, integer bitRate) -> bool OK --------------------------------------------------------------- IMPORTANT NOTICE: ================= The mem2mp3 function also requires the two xtras 'Mix Services.x32' and 'Sound Import Export.x32'! Description: ============ Exports the sound member 'soundMem' to MP3 file 'outputFile' with specified bitRate (between 8 and 350(?)). Example usage: ============== ok = mp3Xtra.mem2mp3(member("snd"), _movie.path&"test.mp3", 128) --------------------------------------------------------------- mem2wav (object me, object soundMem, string outputFile) -> bool OK --------------------------------------------------------------- IMPORTANT NOTICE: ================= The mem2wav function also requires the two xtras 'Mix Services.x32' and 'Sound Import Export.x32'! Description: ============ Exports the sound member 'soundMem' to WAV file 'outputFile'. Example usage: ============== ok = mp3.mem2wav(member("snd"), _movie.path&"test.wav") *************************************************************** LINKS *************************************************************** http://en.wikipedia.org/wiki/LAME http://lame.sourceforge.net/ http://mitiok.maresweb.de/ http://bladeenc.mp3.no/