Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 PlaySoundOnce, PlaySoundLooped, StopSound

View previous topic View next topic Go down 
AuthorMessage
d.j.peters

avatar

Number of posts : 14
Age : 52
Registration date : 2010-07-31

PostSubject: PlaySoundOnce, PlaySoundLooped, StopSound   Thu Aug 05, 2010 7:04 am

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

Back to top Go down
View user profile http://shiny3d.de
d.j.peters

avatar

Number of posts : 14
Age : 52
Registration date : 2010-07-31

PostSubject: Re: PlaySoundOnce, PlaySoundLooped, StopSound   Thu Aug 05, 2010 1:21 pm

looks like the bug is gone
in version 0.9.20i2 i get sound with the PLAY N command.

DJ
Back to top Go down
View user profile http://shiny3d.de
Severin



Number of posts : 19
Localisation : Germany/Braunschweig
Registration date : 2010-12-13

PostSubject: Re: PlaySoundOnce, PlaySoundLooped, StopSound   Sat Mar 30, 2013 8:02 am

****************************************
PANORAMIC V 0.9.24 ist verfügbar
PANORAMIC V 0.9.24 is available
PANORAMIC V 0.9.24 est disponible
PANORAMIC V 0.9.24 es disponible

Das Forum Panoramic ist wieder aktiv.
Bitte besucht uns.

The forum Panoramic is active again.

Please, visits us.

Le forum Panoramic est actif de nouveau.

S'il vous plaît, nous visite.

El foro Panoramic es de nuevo activo.

Por favor, nos visita.
********************************************
Back to top Go down
View user profile
ygeronimi

avatar

Number of posts : 14
Age : 46
Localisation : France
Registration date : 2013-03-13

PostSubject: re   Sat Mar 30, 2013 2:44 pm

You can download Panoramic 0.9.24 here :

Panoramic 0.9.24
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: PlaySoundOnce, PlaySoundLooped, StopSound   

Back to top Go down
 
PlaySoundOnce, PlaySoundLooped, StopSound
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: