Weekly Qbasic and Qb64 Lesson Topics
March 28, 2024, 03:54:51 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

Auto play Sound then auto exit

Pages: [1]
  Print  
Author Topic: Auto play Sound then auto exit  (Read 1600 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: April 13, 2012, 08:54:36 pm »

 Auto play Sound then auto exit
You can play a wav file, for sound using this.
Code:
REM
DEFLNG A-Z

wav1& = _SNDOPEN("anywavfile.wav", "sync,vol")
_SNDVOL wav1&, 0.9
t1 = _FREETIMER
ON TIMER(t1, 10) GOSUB Finish 'the "10" is 10 seconds
TIMER(t1) ON
PRINT "This is my wav sound or music""


DO
  IF NOT _SNDPLAYING(wav1&) THEN
    _SNDPLAY wav1&
  END IF
LOOP WHILE Done = 0

TIMER(t1) OFF
TIMER(t1) FREE
_SNDSTOP wav1&
_SNDCLOSE wav1&
SLEEP 1
SYSTEM

Finish:
Done = 1
RETURN

   Use any WAV file,where it says, "anywavfile.wav" The wav will continue to be played until on timer auto end is reached.
Be sure to change the name to the name of the file you use,
 Also the file must be in the same folder as QB64.
 
______________----__________________________---___--------
Quote
Garry mentioned MIDI tunes & I remembered Barry Taylor who produced some 500 MIDI works of high quality.  He did the traditional music of England, Scotland, Ireland, Canada, America...  Link is:

http://www.contemplator.com/tunebook/

A lot of MIDI stuff is rather stilted and lacking in feeling but this is good stuff because Barry Taylor has the gift.

--Quark
Quote
« Last Edit: April 13, 2012, 10:41:08 pm by GarrisonRicketson » Report Spam   Logged

Share on Facebook Share on Twitter


Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy