bonjour, je suis débutant et je souhaite savoir comment peut on jouer un son wav avec visual studio, j'ai ce code qui, à la génération, me signifie que le chemin d'accés est inexistant alors qu'il est juste :
merci pour votre aide...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 // Create the SoundPlayer object System.Media.SoundPlayer s = new System.Media.SoundPlayer(); // Set the location of the wav file to play s.SoundLocation = @"C://Windows/Media/carillon.wav"; /*myPath*/ ; // Play looping //s.PlayLooping(); // Play normal s.Play(); // Stop s.Stop();
Partager