Met en pause un fichier son qui est en train d'�tre jou�
#include <Sound.au3>
_SoundPause ( $aSndID )
$aSndId | Tableau d'identification du son retourn� par _SoundOpen() ou un nom de fichier |
Succ�s: | Retourne 1. |
�chec: | Retourne 0 et d�finit @error <> 0. |
@error: |
1 = La pause a �chou�e 3 = Identification invalide du son. Utiliser le tableau retourn� par _SoundOpen() ou un nom de fichier valide. |
_SoundOpen, _SoundPlay, _SoundResume
#include <MsgBoxConstants.au3> #include <Sound.au3> Local $aSound = _SoundOpen(@WindowsDir & "\media\tada.wav") If @error = 2 Then MsgBox($MB_SYSTEMMODAL, "Erreur", "Le fichier n'existe pas.") Exit ElseIf @extended <> 0 Then Local $iExtended = @extended ; Parce que @extended sera d�fini apr�s DllCall. Local $tText = DllStructCreate("char[128]") DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $iExtended, "ptr", DllStructGetPtr($tText), "int", 128) MsgBox($MB_SYSTEMMODAL, "Erreur", "L'ouverture a �chou�." & @CRLF & "Num�ro de l'erreur: " & $iExtended & @CRLF & "Description de l'erreur: " & DllStructGetData($tText, 1) & @CRLF & "Notez SVP: Le son peut encore jouer correctement.") Else MsgBox($MB_SYSTEMMODAL, "Succ�s", "Le fichier a �t� ouvert avec succ�s.") EndIf _SoundPlay($aSound) Sleep(1000) _SoundPause($aSound) Sleep(1000) _SoundResume($aSound) Do Sleep(100) Until _SoundPos($aSound, 2) >= _SoundLength($aSound, 2) _SoundClose($aSound)