News:

Function Finder  Find all the functions within source code files

Main Menu

simple sound playing

Started by jahjahjah, November 08, 2007, 06:22:42 AM

Previous topic - Next topic

jahjahjah

Hi purchased playbasic last night basically plagurised this realy simple script from the help files

; loads sound

loadsound"wavs\Alfonse_Mouzon_-_By_All_Means.wav", 1

; loops sound ?

loopsound 1
;self explanitory
playsound 1

do
cls 0

print "jah, q to quit"



jah$=inkey$()

if jah$ = "q" then end
if jah$= "Q" then  end

sync

loop







eventually I realised where to put the wav file and got the appropriate screen come up with no errors but there is no sound coming from the thing, anyideas? thanks

jahjahjah

ok by some miracle it just started working could be to do with my pc methinks.
in the meantime I see you can use dll's with this does this include stuff like bass and fmod and if so anyone know where I can find some nice sound libarys with stuff like multiple fx, asio, and midi input with preferable a sample offset trigger capability that have to be easy to use I tried using fmod and bass with freebasic but it seemed difficult to get them going as there were little to few tutorials or sample scripts for basic.
Also if they were free for commercial aswell as non commercial use this would be spectacular.

Anyway peace out for now :0)

jahjahjah

ok so I noticed its not to do with my pc that it wass playing at first its due to not initialising sound playback because it work straight after I had played something on winamp which must initialise the soundcard in some way this I have double checked.

also this doesnt seem to work ::: 

SoundMasterVolume 255

; loads sound

loadsound"wavs\Alfonse_Mouzon_-_By_All_Means.wav", 1

; loops sound ?

loopsound 1
;self explanitory
playsound 1

do
cls 0

print "jah, q to quit"
Print "Hit Space Bar to Pause/Resume Looping Sound"



jah$=inkey$()

if jah$ = "q" then end
if jah$= "Q" then  end
If jah$=" " then gosub notagain

   
sync

loop





; it will play the sound and then pause it but it doesnt like resuming it for some reason ??????



notagain:
if getsoundplaying(1)=0 then resumesound 1
if getsoundplaying(1)=1 then pausesound 1

return


end

kevin


How big is this file ?  Alfonse_Mouzon_-_By_All_Means.wav

If it's bigger than say a 500k you sound be using the MUSIC commands rather than Sound commands to play it.  See LoadMusic/PLayMusic etc


jahjahjah

2.83 MB ok fair enough on the case