tous d'abord je voudrais préciser que le mérite de cette source doit être
attribué a "conte zero" qui m'a bien aiguille sur l'API a utiliser
merci encore
ce bout de code permet de jouer une ressource .mid en boucle
mais avec un défaut: une latence de 1 à 2 secondes entre chaque reprise
j'ai bien trouve sur MSDN une possibilité : avec repeat

http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx

mais je n'arrive pas a la faire fonctionner ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
mciSendString("play SongMid repeat", Nothing, 0, 0)
ne donne rien .


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Imports System.IO
 
 
Public Class Form1
    Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, _
     ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer
 
    Dim path_muzik As String = ""
 
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
        path_muzik = Application.StartupPath & "\song.mid"
 
        If File.Exists(path_muzik) = False Then
            File.WriteAllBytes(path_muzik, My.Resources.song)   ' copîe la ressource sur le dir de l'appli
            File.SetAttributes(path_muzik, FileAttributes.Hidden)
        End If
 
        zik()
        '____________________________________________________________________
        'METHODE POUR RECUPERER LA LONGUEUR DU .MID
        Dim RetString As New String(" "c, 50)
        mciSendString("Set SongMid time format milliseconds", Nothing, 0, 0)
        mciSendString("Status SongMid length", RetString, RetString.Length, 0)
 
        Dim temp As String = Replace(RetString, Chr(34), "") 'mise en forme du temps .mid pour convertion integer
        temp = Replace(temp, " ", "")
        '___________________________________________________________
 
        Timer_song.Interval = Conversion.Int(temp) + 1000  '+1000 evite la coupure avant la fin du .mid
        Timer_song.Enabled = True
    End Sub
 
    Sub zik()
        Dim muzik As String = Chr(34) & path_muzik & Chr(34)
        mciSendString("open " & muzik & " alias SongMid", Nothing, 0, 0)
        mciSendString("play SongMid", Nothing, 0, 0)
 
    End Sub
 
    Private Sub Timer_song_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer_song.Tick
        mciSendString("close SongMid", Nothing, 0, 0) 'on ferme pour reouvrir c'est surement la que le delai devient important. mais j'ai pas mieux ....
        zik()
    End Sub
    Private Sub Btn_exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_exit.Click
        mciSendString("close SongMid", Nothing, 0, 0)
        File.Delete(path_muzik)
        Me.Dispose()
    End Sub
End Class
voila si vous avez la solution permettant de réduire fortement cette latence
je suis preneur
merci