Son wave .NET

cs_ralebole Messages postés 208 Date d'inscription mardi 29 novembre 2005 Statut Membre Dernière intervention 5 janvier 2023 - 4 janv. 2006 à 21:05
otacon67 Messages postés 10 Date d'inscription mardi 15 novembre 2005 Statut Membre Dernière intervention 1 février 2007 - 1 févr. 2007 à 09:48
Comment jouer un son wave à l'aide de PlaySound
dans une application Windows Forms (.NET)
que faut' il declarer ?


svp un exemple merci.

4 réponses

CoyoteVsBeepBeep Messages postés 41 Date d'inscription jeudi 16 juin 2005 Statut Membre Dernière intervention 3 mars 2006
5 janv. 2006 à 09:49
hello,
rien de specifique a charger.
tu fais directement
PlaySound(".\\sound\\sound.wav",NULL,SND_SYNC );
ou
PlaySound("chemin_complet de ton wav",NULL,SND_SYNC );

attention, ca joue que des wav. pas de mp3
0
otacon67 Messages postés 10 Date d'inscription mardi 15 novembre 2005 Statut Membre Dernière intervention 1 février 2007
30 janv. 2007 à 14:25
slt tout le monde, je cherche egalement a jouer un son wave...mais malheuresement, quand je mets

PlaySound("chemin_complet ",NULL,SND_SYNC );
avec la bliblioteque
#include "mmsystem.h"

il me retorque
error C2664: 'PlaySoundW' : impossible de convertir le paramètre 1 de 'const char [26]' en 'LPCWSTR'

je suis desesperé surtout que ca a pas l'air dificile...j'ai bo changer les wave, rien ne change HELP ME PLEASE
0
cs_ralebole Messages postés 208 Date d'inscription mardi 29 novembre 2005 Statut Membre Dernière intervention 5 janvier 2023 1
30 janv. 2007 à 20:46
Salut voila pour ton probleme moi aussi j'ai galerer

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


Public Const SND_SYNC = &H0 ' Jouer synchrone (par défaut)
Public Const SND_ASYNC = &H1 ' Jouer en asynchrone
Public Const SND_LOOP = &H8 ' Répéter le son jusqu'au prochain son
Public Const SND_STOP = &H4 'Arrête le fichier son
 
 Private Sub Button1Click(sender As System.Object, e As System.EventArgs)
 
sndPlaySound ("test.wav", SND_ASYNC) 'Jouer en asynchrone

End Sub
0
otacon67 Messages postés 10 Date d'inscription mardi 15 novembre 2005 Statut Membre Dernière intervention 1 février 2007
1 févr. 2007 à 09:48
nickel chrome, cimer ralebole...

see you later
0
Rejoignez-nous