d.j.peters
Nombre de messages : 77 Age : 60 Localisation : Germany Date d'inscription : 31/07/2010
| Sujet: PlaySoundOnce, PlaySoundLooped, StopSound Jeu 5 Aoû 2010 - 5:58 | |
| Sorry english i get no sound in Release 0.9.19 dated June 17, 2010 but here are an simple work around. DJ Download: PlayWave.zip - Code:
-
' step1: set filename ' e.g. SoundFile$ = "mywave.wav" ' step2: get pointer of the filename ' e.g. gosub GetpChar ' step3: play it once or looped ' e.g. gosub PlaySoundOnce ' or gosub PlaySoundLooped ' repeat step3 (or for an other sound start with step1) ' ' NOTE: ' you can stop a playing sound with: gosub SoundStop
label GetpChar,PlaySoundOnce,PlaySoundLooped,StopSound
dim ret%,pChar%,flags% dim SoundFile$
' step1 SoundFile$="Loop01.wav" ' step2 gosub GetpChar ' step3 gosub PlaySoundLooped ' or PlaySoundOnce
end
GetpChar: if file_exists(SoundFile$)=0 then return dll_on "kernel32.dll" pChar% = adr(SoundFile$) ret%=DLL_CALL3("RtlMoveMemory",adr(pChar%),pChar%,4) dll_off: return
PlaySoundOnce: if pChar%=0 then return dll_on "winmm.dll": flags%=131072 + 16 + 1 ret%=DLL_CALL2("sndPlaySoundA",pChar%,flags%):return
PlaySoundLooped: if pChar%=0 then return dll_on "winmm.dll": flags%=131072 + 16 + 8 + 1 ret%=DLL_CALL2("sndPlaySoundA",pChar%,flags%):return
StopSound: dll_on "winmm.dll": flags%=0 ret%=DLL_CALL2("sndPlaySoundA",flags%,flags%):return
| |
|
Nardo26
Nombre de messages : 2294 Age : 56 Localisation : Valence Date d'inscription : 02/07/2010
| Sujet: Re: PlaySoundOnce, PlaySoundLooped, StopSound Jeu 5 Aoû 2010 - 10:26 | |
| You can try this : - Code:
-
sound 1 file_load 1,"PlayWave\Loop01.wav" play 1
But you can't play it twice... why ? I don't know.... | |
|
d.j.peters
Nombre de messages : 77 Age : 60 Localisation : Germany Date d'inscription : 31/07/2010
| Sujet: Re: PlaySoundOnce, PlaySoundLooped, StopSound Jeu 5 Aoû 2010 - 11:38 | |
| Hello Nardo, my version of Panoramic (Release 0.9.19 dated June 17, 2010) has a bug and can't play movies or sounds. What is your version of Panoramic ? DJ here are the error message: | |
|
Nardo26
Nombre de messages : 2294 Age : 56 Localisation : Valence Date d'inscription : 02/07/2010
| Sujet: Re: PlaySoundOnce, PlaySoundLooped, StopSound Jeu 5 Aoû 2010 - 11:47 | |
| | |
|
d.j.peters
Nombre de messages : 77 Age : 60 Localisation : Germany Date d'inscription : 31/07/2010
| Sujet: Re: PlaySoundOnce, PlaySoundLooped, StopSound Jeu 5 Aoû 2010 - 12:19 | |
| Thank you Norda with version V0.9.202i i get sound with play PLAY N command.
DJ
| |
|
Nardo26
Nombre de messages : 2294 Age : 56 Localisation : Valence Date d'inscription : 02/07/2010
| Sujet: Re: PlaySoundOnce, PlaySoundLooped, StopSound Jeu 5 Aoû 2010 - 12:28 | |
| I don't know why but
sound 1 file_load 1,"PlayWave\Loop01.wav" play 1 wait 2000 play 1
the file wav is played one time....
| |
|
Contenu sponsorisé
| Sujet: Re: PlaySoundOnce, PlaySoundLooped, StopSound | |
| |
|