Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 12 odgovora
  • 6.293 pregleda

Najnovija ↓

Melodija u programu! 06.09.2004. u 13:38 · pre 269 meseci #1
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.
Re: Melodija u programu! 06.09.2004. u 13:56 · pre 269 meseci #2
'modul
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

'code
Code:

Dim lRetVal As Long
lRetVal = sndPlaySound("C:\x.wav", SND_ASYNC)


'ps

E sad samo ubaci ovaj kod u loop nekog tajmera ...

Re: Melodija u programu! 06.09.2004. u 14:02 · pre 269 meseci #3
Citat:
`and:
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.


Code:

lRetVal = sndPlaySound("C:\x.wav", SND_ASYNC Or SND_LOOP)
Potpis
Blue Man Group
Re: Melodija u programu! 06.09.2004. u 16:10 · pre 269 meseci #5
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
Re: Melodija u programu! 06.09.2004. u 20:10 · pre 269 meseci #6
A da li se moze ikako ubaciti neki kratki mp3 ili wav u exe datoteku???
Potpis
[ :. n!t .: ]
Re: Melodija u programu! 06.09.2004. u 20:26 · pre 269 meseci #7
ja mislim da ne može,ali nisam siguran....
Re: Melodija u programu! 06.09.2004. u 20:31 · pre 269 meseci #8
Znaci moramo non stop teglit prokleti wav??
a da li se moze uraditi nesto poput midi-ja??
Potpis
[ :. n!t .: ]
Re: Melodija u programu! 06.09.2004. u 20:36 · pre 269 meseci #9
A čekaj na što si ti mislio.. Je si li mislio može li se pokrećati mp3 fajl... ili ....
Re: Melodija u programu! 06.09.2004. u 20:41 · pre 269 meseci #10
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
Potpis
[ :. n!t .: ]
Re: Melodija u programu! 07.09.2004. u 09:48 · pre 269 meseci #11
U resource fajlu mozes da cuvas sta hoces, pa i mp3 i midi.
Potpis
Blue Man Group
Re: Melodija u programu! 07.09.2004. u 15:58 · pre 269 meseci #12
znam sta se moze sve cuvati u njemu
ALI KAKO DA POKRENEM IZ NJEGA!!!!
to te ja pitam...
Potpis
[ :. n!t .: ]
Re: Melodija u programu! 07.09.2004. u 16:10 · pre 269 meseci #13
Imas funkcije LoadResData, LoadResString i LoadResPicture koje "vade" podatke iz resourcea
Potpis
Blue Man Group
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme