时间: 2021-07-31 作者:daque
' #vbideutils#************************************************************' * programmer name : waty thierry' * web site : www.geocities.com/researchtriangle/6311/' * e-mail : waty.thierry@usa.net' * date : 29/10/98' * time : 14:31' * module name : browse_folder' * module filename : browse_folder.bas' **********************************************************************' * comments : recording a cd to a wave file' * this function uses the multimedia control interface (mci) to control the cd drive.' **********************************************************************public sub recordwave(tracknum as integer, filename as string)' tracknum: track to record' filename: file to save wave ason local error resume nextdim i as long, rs as string, cb as long, t#rs = space$(128)i = mcisendstring("stop cdaudio", rs, 128, cb)i = mcisendstring("close cdaudio", rs, 128, cb)kill filenamers = space$(128)i = mcisendstring("status cdaudio position track " & tracknum, rs, 128, cb)i = mcisendstring("open cdaudio", rs, 128, cb)i = mcisendstring("set cdaudio time format milliseconds", rs, 128, cb)i = mcisendstring("play cdaudio", rs, 128, cb)i = mcisendstring("open new type waveaudio alias capture", rs, 128, cb)i = mcisendstring("record capture", rs, 128, cb)t# = timer + 1: do until timer > t#: doevents: loopi = mcisendstring("save capture " & filename, rs, 128, cb)i = mcisendstring("stop cdaudio", rs, 128, cb)i = mcisendstring("close cdaudio", rs, 128, cb)end sub'the method is quite easy:''1) stop everything in the cd drive'2) start playing track'3) record a new wave with the information from the cd (note: it also records midi and microphone sounds: in fact anything coming out of the speakers)'4) save the wave file'5) stop the cd again