ChannelPlaying.htm 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>ChannelPlaying (channel_handle)</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. channel_handle = variable assigned to the channel when played
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Often you will need to know if a sound channel has completed playing or not. This command will return 1 if the sound is still playing or 0 if it has stopped. Use this to restart your background music or some other sound that might have stopped unintentionally. <br />
  21. <br />
  22. Note: This command currently doesn't seem to work with a channel assigned to CD track playback.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../2d_examples/ChannelPlaying.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; Channel examples <br />
  31. <br />
  32. Print "Loading sound ..." <br />
  33. ; Load the sample - you'll need to point this to a sound on your computer <br />
  34. ; For best results, make it about 5-10 seconds... <br />
  35. sndWave=LoadSound("level1.wav") <br />
  36. <br />
  37. Print "Playing full sample until sound is done ..." <br />
  38. chnWave=PlaySound(sndWave) <br />
  39. While ChannelPlaying(chnWave) <br />
  40. Wend <br />
  41. Print "All done!" <br />
  42. </td>
  43. </tr>
  44. </table>
  45. <br>
  46. <a target=_top href=../index.htm>Index</a><br>
  47. <br>
  48. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=ChannelPlaying&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  49. </html>