Jamester
11-04-2010, 10:48
Il codice in un file .BAS è questo:
Const SND_ASYNC = &H1
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal _
lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Function PlayWAV(FileName As String, Optional SyncExec As Boolean) As Boolean
If SyncExec Then
' play the file synchronously
PlayWAV = PlaySound(FileName, 0, 0)
Else
' play the file asynchronously
PlayWAV = PlaySound(FileName, 0, SND_ASYNC)
End If
End Function
E la seguente riga di comando in un frmsplash:
PlayWAV (App.Path & "\Sounds\Only Us.wav")
Ora il problema è che fino a un po' di tempo fa funzionava e ora non più. Tutti i file wav funzionano eccetto un wav di circa 2 mega. Potreste dirmi il perchè ? Sto codice nn legge un file di una lunghezza superiore a un tot? eppure prima andava :(
Const SND_ASYNC = &H1
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal _
lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Function PlayWAV(FileName As String, Optional SyncExec As Boolean) As Boolean
If SyncExec Then
' play the file synchronously
PlayWAV = PlaySound(FileName, 0, 0)
Else
' play the file asynchronously
PlayWAV = PlaySound(FileName, 0, SND_ASYNC)
End If
End Function
E la seguente riga di comando in un frmsplash:
PlayWAV (App.Path & "\Sounds\Only Us.wav")
Ora il problema è che fino a un po' di tempo fa funzionava e ora non più. Tutti i file wav funzionano eccetto un wav di circa 2 mega. Potreste dirmi il perchè ? Sto codice nn legge un file di una lunghezza superiore a un tot? eppure prima andava :(