Moze li mi neko reci i dati kod za melodiju u programu. Znaci kada napravim program i kad ga pokrenem da se automatski pokrene i melodija i da se stalno ponavlja.
Melodija u programu!
Zaključano
Zakačeno
'modul
'code
'ps
E sad samo ubaci ovaj kod u loop nekog tajmera ...
Code:
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
Public Const SND_SYNC = &H0
Public Const SND_LOOP = &H8
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Const SND_ASYNC = &H1
Public Const SND_SYNC = &H0
Public Const SND_LOOP = &H8
'code
Code:
Dim lRetVal As Long
lRetVal = sndPlaySound("C:\x.wav", SND_ASYNC)
Dim lRetVal As Long
lRetVal = sndPlaySound("C:\x.wav", SND_ASYNC)
'ps
E sad samo ubaci ovaj kod u loop nekog tajmera ...
Citat:
`and:
E sad samo ubaci ovaj kod u loop nekog tajmera ...
E sad samo ubaci ovaj kod u loop nekog tajmera ...
Zasto onda imas konstantu za loop?
Citat:
Parameters:
· lpszSound
A string that specifies the sound to play. This parameter can be either an entry in the registry or in WIN.INI that identifies a system sound, or it can be the name of a waveform-audio file. (If the function does not find the entry, the parameter is treated as a filename.) If this parameter is NULL, any currently playing sound is stopped.
· fuSound
Flags for playing the sound. The following values are defined:
SND_ASYNC
The sound is played asynchronously and the function returns immediately after beginning the sound. To terminate an asynchronously played sound, call sndPlaySound with lpszSoundName set to NULL.
SND_LOOP
The sound plays repeatedly until sndPlaySound is called again with the lpszSoundName parameter set to NULL. You must also specify the SND_ASYNC flag to loop sounds.
SND_MEMORY
The parameter specified by lpszSoundName points to an image of a waveform sound in memory.
SND_NODEFAULT
If the sound cannot be found, the function returns silently without playing the default sound.
SND_NOSTOP
If a sound is currently playing, the function immediately returns FALSE, without playing the requested sound.
SND_SYNC
The sound is played synchronously and the function does not return until the sound ends.
· lpszSound
A string that specifies the sound to play. This parameter can be either an entry in the registry or in WIN.INI that identifies a system sound, or it can be the name of a waveform-audio file. (If the function does not find the entry, the parameter is treated as a filename.) If this parameter is NULL, any currently playing sound is stopped.
· fuSound
Flags for playing the sound. The following values are defined:
SND_ASYNC
The sound is played asynchronously and the function returns immediately after beginning the sound. To terminate an asynchronously played sound, call sndPlaySound with lpszSoundName set to NULL.
SND_LOOP
The sound plays repeatedly until sndPlaySound is called again with the lpszSoundName parameter set to NULL. You must also specify the SND_ASYNC flag to loop sounds.
SND_MEMORY
The parameter specified by lpszSoundName points to an image of a waveform sound in memory.
SND_NODEFAULT
If the sound cannot be found, the function returns silently without playing the default sound.
SND_NOSTOP
If a sound is currently playing, the function immediately returns FALSE, without playing the requested sound.
SND_SYNC
The sound is played synchronously and the function does not return until the sound ends.
Code:
lRetVal = sndPlaySound("C:\x.wav", SND_ASYNC Or SND_LOOP)
lRetVal = sndPlaySound("C:\x.wav", SND_ASYNC Or SND_LOOP)
Potpis
oops moja greska ... nisam obracao paznju ... tnx
Ja sam koristio ovo iz API-ja
Code:
Private Const SND_APPLICATION = &H80 ' look for application specific association
Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_FILENAME = &H20000 ' name is a file name
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Private Const SND_PURGE = &H40 ' purge non-static events for task
Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom
Private Const SND_SYNC = &H0 ' play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: [email protected]
PlaySound "C:\WINDOWS\MEDIA\recycle.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub
Private Const SND_APPLICATION = &H80 ' look for application specific association
Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_FILENAME = &H20000 ' name is a file name
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Private Const SND_PURGE = &H40 ' purge non-static events for task
Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom
Private Const SND_SYNC = &H0 ' play synchronously (default)
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" _
(ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: [email protected]
PlaySound "C:\WINDOWS\MEDIA\recycle.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub
A da li se moze ikako ubaciti neki kratki mp3 ili wav u exe datoteku???
Potpis
[ :. n!t .: ]
ja mislim da ne može,ali nisam siguran....
Znaci moramo non stop teglit prokleti wav??
a da li se moze uraditi nesto poput midi-ja??
a da li se moze uraditi nesto poput midi-ja??
Potpis
[ :. n!t .: ]
A čekaj na što si ti mislio.. Je si li mislio može li se pokrećati mp3 fajl... ili ....
Ne nisam to mislio (pokretanje mp3) mislio sam da li se moze ubaciti u exe fajl
kao naprimjer *.res fajlovi
a sta bi s ovim:
da li se moze ubaciti midi (kako) jer sam primijetio nekoliko
source codova na netu koji omogucavaju pravljenje nesto poput midija
da li se to moze ubaciti u kod
kao naprimjer *.res fajlovi
a sta bi s ovim:
da li se moze ubaciti midi (kako) jer sam primijetio nekoliko
source codova na netu koji omogucavaju pravljenje nesto poput midija
da li se to moze ubaciti u kod
Potpis
[ :. n!t .: ]
U resource fajlu mozes da cuvas sta hoces, pa i mp3 i midi.
Potpis
znam sta se moze sve cuvati u njemu
ALI KAKO DA POKRENEM IZ NJEGA!!!!
to te ja pitam...
ALI KAKO DA POKRENEM IZ NJEGA!!!!
to te ja pitam...
Potpis
[ :. n!t .: ]
Imas funkcije LoadResData, LoadResString i LoadResPicture koje "vade" podatke iz resourcea