Come faccio ad inserire un suono durante l'esecuzione del form?
Grazie![]()
Come faccio ad inserire un suono durante l'esecuzione del form?
Grazie![]()
Prova con:
codice:Declare Function PlaySound Lib "winmm.dll" (ByVal szSound As Char(), ByVal hMod As IntPtr, ByVal flags As PlaySoundFlags) As Integer <Flags()> Public Enum PlaySoundFlags SND_SYNC = &H0 SND_ASYNC = &H1 SND_NODEFAULT = &H2 SND_MEMORY = &H4 SND_LOOP = &H8 SND_NOSTOP = &H10 SND_NOWAIT = &H2000 SND_ALIAS = &H10000 SND_ALIAS_ID = &H110000 SND_FILENAME = &H20000 SND_RESOURCE = &H40004 End Enum PlaySound(FILE_NAME, IntPtr.Zero, PlaySoundFlags.SND_LOOP)![]()
Scusami ma con questo codice mi da 4 errori:
-Declare Function...
-<Flags()>...
-Playsound...(che ho pensato di cambiare in a=playsound)
-File_Name
code:
Declare Function PlaySound Lib "winmm.dll" (ByVal szSound As Char(), ByVal hMod As IntPtr, ByVal flags As PlaySoundFlags) As Integer
<Flags()> Public Enum PlaySoundFlags
SND_SYNC = &H0
SND_ASYNC = &H1
SND_NODEFAULT = &H2
SND_MEMORY = &H4
SND_LOOP = &H8
SND_NOSTOP = &H10
SND_NOWAIT = &H2000
SND_ALIAS = &H10000
SND_ALIAS_ID = &H110000
SND_FILENAME = &H20000
SND_RESOURCE = &H40004
End Enum
PlaySound(FILE_NAME, IntPtr.Zero, PlaySoundFlags.SND_LOOP)
Non so proprio come fare!!!!!!
help me!![]()
lomiz, sei capace di usare il file di risorse?
Se si, o se decidi di usarlo (ti consiglio in tal senso) ti posto il codice per riprodurre un suono caricandolo dal predetto file.
Fammi sapere.![]()
LM
sbaglio o nel file risorse puoi mettere file molto piccoli?!?
ditemi voi...nn ricordo bene....
Scusami tu perché il metodo che ti ho postato può essere usato così com'è in Vb.Net, per usarlo in VB6 bisogna fare qualche piccola modifica. Comunque segui questo sito:Scusami ma con questo codice mi da 4 errori:
-Declare Function...
-<Flags()>...
-Playsound...(che ho pensato di cambiare in a=playsound)
-File_Name
http://www.visual-basic.it/articoli/fddAudio.htm
![]()
ranza!!!123,
MSDN NON dà riferimenti in tal senso e poi non credo che si voglia suonare un'intera sinfonia, sich ...VVoVe:
LM