Lire un fichier WAV en VBA
Salut la compagnie,
avant sous Windows XP32 / Excel 2003, pour lire un fichier WAV en VBA j'utilisais le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Function MessageSonore(P_Fichier_wav)
Application.ScreenUpdating = False
WFichier_txt = G_DOSSIER_SPEECH & "\" & P_Fichier_wav
If Test_Fichier(WFichier_txt, False) = True Then
ShellWait "sndrec32 /play /Close " & WFichier_txt
Else
ShellWait "sndrec32 /play /Close " & G_DOSSIER_SPEECH & "\" & "message_sonore_inexistant.wav"
End If
End Function
Public Sub ShellWait(ByVal JobToDo As String)
Dim hProcess As Long, RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(JobToDo, vbMinimizedNoFocus))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents
Loop While RetVal = STILL_ACTIVE
End Sub |
Mais depuis, je suis sous Seven64 / Excel 2003 et ça ne fonctionne plus, car le fichier SNREC32.EXE n'est plus présent.
La question est donc comment faire, maintenant ?
Merci d'avance pour votre aide.