[VB.NET]Lecture de son mp3 avec DirecX

shadow1779 Messages postés 706 Date d'inscription mercredi 17 novembre 2004 Statut Membre Dernière intervention 29 septembre 2013 - 13 mars 2006 à 18:05
cs_anaali Messages postés 1 Date d'inscription mercredi 13 août 2008 Statut Membre Dernière intervention 18 août 2008 - 18 août 2008 à 17:07
Bonjour je cherche a faire un lecteur mp3 en utilisant DirecX 9, j'ai télécharger le SDK de directX, et importé les references

Microsoft.DirectX

Microsoft.DirectX.AudioVideoPlayback

j'ai mis en haut du code de mon winform

Imports Microsoft.DirectX

Imports Microsoft.DirectX.AudioVideoPlayback

et dans mon form_load j'ai mis

Audio.FromFile(
"c:\test.mp3")

Cependant quand je veux faire Audio.Play, la methode Play est introuvable, elle est cependant visible dans l'object browser, les seules choses que je vois quand je met Audio. sont FromFile et FromUrl, pas de play, pause, stop, balance ...

4 réponses

Utilisateur anonyme
13 mars 2006 à 18:21
Salut,

Et comme ca ?
Microsoft.DirectX.AudioVideoPlayback.Audio.FromFile("c:\test.mp3").Play()

ou bien comme ca ?
Dim AudioFile As New Microsoft.DirectX.AudioVideoPlayback.Audio("c:\test.mp3")
AudioFile.Play()

Audio, c'est une classe, il faut l'intensifier avant de l'utiliser.

Kenji

Merci de cliquer sur "Réponse acceptée" si une réponse vous convient.
0
shadow1779 Messages postés 706 Date d'inscription mercredi 17 novembre 2004 Statut Membre Dernière intervention 29 septembre 2013
13 mars 2006 à 18:54
merci déja Microsoft.DirectX.AudioVideoPlayback.Audio.FromFile("c:\test.mp3").Play() marche, mais par contre au lancement du programme cela génère une erreur

Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.


************** Texte de l'exception **************
Erreur de l'application.
-2147220968 (VFW_E_CANNOT_RENDER)
à Microsoft.DirectX.AudioVideoPlayback.Audio.Open(String fileName, Boolean autoRun)
à Microsoft.DirectX.AudioVideoPlayback.Audio..ctor(String fileName, Boolean autoRun)
à Microsoft.DirectX.AudioVideoPlayback.Audio.FromFile(String filename)
à Mp3Player.Form1.Form1_Load(Object sender, EventArgs e) dans C:\Documents and Settings\Shadow\Mes documents\Visual Studio 2005\Projects\Mp3Player\Mp3Player\Form1.vb:ligne 6
à System.EventHandler.Invoke(Object sender, EventArgs e)
à System.Windows.Forms.Form.OnLoad(EventArgs e)
à System.Windows.Forms.Form.OnCreateControl()
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.Control.CreateControl()
à System.Windows.Forms.Control.WmShowWindow(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ScrollableControl.WndProc(Message& m)
à System.Windows.Forms.ContainerControl.WndProc(Message& m)
à System.Windows.Forms.Form.WmShowWindow(Message& m)
à System.Windows.Forms.Form.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



************** Assemblys chargés **************
mscorlib
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll]
----------------------------------------
Mp3Player
Version de l'assembly : 1.0.0.0
Version Win32 : 1.0.0.0
CodeBase : [file:///C:/Documents%20and%20Settings/Shadow/Mes%20documents/Visual%20Studio%202005/Projects/Mp3Player/Mp3Player/bin/Debug/Mp3Player.exe file:///C:/Documents%20and%20Settings/Shadow/Mes%20documents/Visual%20Studio%202005/Projects/Mp3Player/Mp3Player/bin/Debug/Mp3Player.exe]
----------------------------------------
Microsoft.VisualBasic
Version de l'assembly : 8.0.0.0
Version Win32 : 8.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll]
----------------------------------------
System
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll]
----------------------------------------
System.Windows.Forms
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll]
----------------------------------------
System.Drawing
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll]
----------------------------------------
System.Configuration
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll]
----------------------------------------
System.Xml
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll]
----------------------------------------
System.Runtime.Remoting
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll]
----------------------------------------
Microsoft.DirectX.AudioVideoPlayback
Version de l'assembly : 1.0.2902.0
Version Win32 : 5.04.00.2904
CodeBase : [file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.AudioVideoPlayback/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.AudioVideoPlayback.dll file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.AudioVideoPlayback/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.AudioVideoPlayback.dll]
----------------------------------------
Microsoft.DirectX
Version de l'assembly : 1.0.2902.0
Version Win32 : 5.04.00.2904
CodeBase : [file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll]
----------------------------------------
mscorlib.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll]
----------------------------------------
System.Windows.Forms.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.42 (RTM.050727-4200)
CodeBase : [file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll]
----------------------------------------


************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.


Par exemple :


<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>


Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.
0
shadow1779 Messages postés 706 Date d'inscription mercredi 17 novembre 2004 Statut Membre Dernière intervention 29 septembre 2013
13 mars 2006 à 21:26
grace a Matrix sur l'irc j'ai pu trouver le probleme, pour tous les préssés, ne pas faire ca dans le form_load c'est ca le bug :)
0
cs_anaali Messages postés 1 Date d'inscription mercredi 13 août 2008 Statut Membre Dernière intervention 18 août 2008
18 août 2008 à 17:07


0
Rejoignez-nous