Play recorded sounds: Difference between revisions
Content added Content deleted
(Added Delphi example) |
({{header|Liberty BASIC}}) |
||
Line 85: | Line 85: | ||
sndPlaySound('SoundFile.wav', SND_NODEFAULT OR SND_ASYNC); |
sndPlaySound('SoundFile.wav', SND_NODEFAULT OR SND_ASYNC); |
||
end.</lang> |
end.</lang> |
||
=={{header|Liberty BASIC}}== |
|||
<lang lb>'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 |
|||
</lang> |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |