PDA

View Full Version : VB6. istruzione per eseguire un wav


davidino80
10-09-2003, 11:49
quale istruzione potrei usare per eseguire un wav?
grazie ciao

matpez
10-09-2003, 15:15
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\TADA.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub


Dvertiti :p

cionci
10-09-2003, 15:15
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\TADA.WAV", ByVal 0&, SND_FILENAME Or SND_ASYNC
End Sub

Ciao...

matpez
10-09-2003, 15:19
Cionci ti ho battuno per quale secondo :p :p :p :p

LOOOOOOOOOOOOOOOOOOOOOOOOL
LOOOOOOOOOOOOOOOOOOOOOOOOL
LOOOOOOOOOOOOOOOOOOOOOOOOL
LOOOOOOOOOOOOOOOOOOOOOOOOL
LOOOOOOOOOOOOOOOOOOOOOOOOL
LOOOOOOOOOOOOOOOOOOOOOOOOL
LOOOOOOOOOOOOOOOOOOOOOOOOL

cionci
10-09-2003, 15:21
Davvero :D Però io ho messo il tag Code !!!! :P

cionci
10-09-2003, 15:21
Ahi ahi ahi...ultima modifica 14:18...quindi ti ho battuto :sofico: :sofico: :sofico:

matpez
10-09-2003, 15:22
:mad:

Va bene hai vinto tu :D :D :D

PS: avevo solo messo "divertiti :p " :oink: :oink: :oink: :oink:

cionci
10-09-2003, 15:23
Ho vinto !!! :yeah: :yeah: :winner: :D :D :D

matpez
10-09-2003, 15:27
:huh: :gluglu: :huh:

Bevo per dimenticare la sconfitta!! :cry:

davidino80
10-09-2003, 15:42
grandi ragazzi.. :p complimenti
grazie e buon lavoro a tutti

cionci
10-09-2003, 15:58
davidino80: un consiglio... www.allapi.net e scarica APIGuide (ed usa il motore di ricerca interno)...

davidino80
10-09-2003, 16:11
buono.. immagino che ci sia un bel db qui dentro.
grazie del link.

per il programmino... semplicemente devo realizzare una decina di tasti assegnabili ad un suono da riprodurre in real time.. per effettistica audio in radio (sai quegli effetti che senti tra un brano e l'altro in radio.. )

grazie ancora. sto già stilando il codice

davidino80
11-09-2003, 16:51
scusate una cosa... Allora il programma funziona e tutto.
Stavo dando un'occhiata a questa sezione:

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)


Le varie costanti come le posso usare?? ad esempio:

SND_NOWAIT = &H2000 ' don't wait if the driver is busy

Sarebbe interessante per fare il play di più wav contemporaneamente.... oppure:

SND_LOOP = &H8 ' loop the sound until next sndPlaySound

Per avere un loop......


Come le posso usare?? dove le devo inserire????

cionci
11-09-2003, 16:54
msdn.microsoft.com e cerca PlaySound ;)

davidino80
11-09-2003, 17:02
thanks :)