41 lines
839 B
Text
41 lines
839 B
Text
'Supports .mid and .wav natively
|
|
'Midi may be played simultaneously
|
|
'with .wav but only one .wav voice
|
|
'is supported. Multiple voices can
|
|
'be achieved via API or Dlls such
|
|
'as FMOD or Wavemix
|
|
|
|
'to play a .mid and return its length
|
|
playmidi "my.mid", midiLength
|
|
|
|
'check where we are in .mid
|
|
if midipos()<midiLength then
|
|
print "Midi still playing"
|
|
else
|
|
print "Midi ended"
|
|
end if
|
|
|
|
'to stop a playing .mid
|
|
stopmidi
|
|
|
|
'to play a .wav and wait for it to end
|
|
playwave "my.wav"
|
|
|
|
'to play a .wav and continue procesing
|
|
playwave "my.wav", async
|
|
|
|
'to loop a .wav and continue processing
|
|
playwave "my.wav",loop
|
|
|
|
'to silence any .wav
|
|
playwave ""
|
|
or
|
|
playwave "next.wav"
|
|
|
|
'to adjust .wav vol
|
|
'set left and right full on
|
|
left =65535
|
|
right=65535
|
|
dwVol=right*65536+left
|
|
calldll #winmm, "waveOutSetVolume", 0 as long, _
|
|
dwVol as long, ret as long
|