Added Microsoft.DirectX.AudioVideoPlayback.dll to the links in the project. When you try to select a file, immediately throws an exception:
System.IO.FileLoadException: "ΠΠ΅ ΡΠ΄Π°Π»ΠΎΡΡ Π·Π°Π³ΡΡΠ·ΠΈΡΡ ΡΠ°ΠΉΠ» ΠΈΠ»ΠΈ ΡΠ±ΠΎΡΠΊΡ "Microsoft.DirectX.AudioVideoPlayback.dll" Π»ΠΈΠ±ΠΎ ΠΎΠ΄Π½Ρ ΠΈΠ· ΠΈΡ
Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ. ΠΡΠΎΠΈΠ·ΠΎΡΠ΅Π» ΡΠ±ΠΎΠΉ Π² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΎΠΉ ΠΊΠΎΠΌΠΏΠΎΠ½ΠΎΠ²ΠΊΠΈ (DLL). (ΠΡΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅ ΠΈΠ· HRESULT: 0x8007045A)" Here is the code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.DirectX.AudioVideoPlayback; namespace AudioMax { public partial class Form1 : Form { Audio audio; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { openFileDialog1.Filter = "Media Files|*.wav;*.mp3;*.wma|All Files|*.*"; } private void playButton_Click(object sender, EventArgs e) { audio.Play(); } private void ejectButton_Click(object sender, EventArgs e) { if(openFileDialog1.ShowDialog() == DialogResult.OK) { audio = new Audio(openFileDialog1.FileName); } } } } Here are the details:
System.IO.FileLoadException HResult=0x8007045A Π‘ΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ = ΠΠ΅ ΡΠ΄Π°Π»ΠΎΡΡ Π·Π°Π³ΡΡΠ·ΠΈΡΡ ΡΠ°ΠΉΠ» ΠΈΠ»ΠΈ ΡΠ±ΠΎΡΠΊΡ "Microsoft.DirectX.AudioVideoPlayback.dll" Π»ΠΈΠ±ΠΎ ΠΎΠ΄Π½Ρ ΠΈΠ· ΠΈΡ
Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ. ΠΡΠΎΠΈΠ·ΠΎΡΠ΅Π» ΡΠ±ΠΎΠΉ Π² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ΅ ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΠΈ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΎΠΉ ΠΊΠΎΠΌΠΏΠΎΠ½ΠΎΠ²ΠΊΠΈ (DLL). (ΠΡΠΊΠ»ΡΡΠ΅Π½ΠΈΠ΅ ΠΈΠ· HRESULT: 0x8007045A) ΠΡΡΠΎΡΠ½ΠΈΠΊ = AudioMax Π’ΡΠ°ΡΡΠΈΡΠΎΠ²ΠΊΠ° ΡΡΠ΅ΠΊΠ°: Π² AudioMax.Form1.ejectButton_Click(Object sender, EventArgs e) Π² C:\Users\YMS21\source\repos\AudioMax\AudioMax\Form1.cs:ΡΡΡΠΎΠΊΠ° 39 Π² System.Windows.Forms.Control.OnClick(EventArgs e) Π² System.Windows.Forms.Button.OnClick(EventArgs e) Π² System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) Π² System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) Π² System.Windows.Forms.Control.WndProc(Message& m) Π² System.Windows.Forms.ButtonBase.WndProc(Message& m) Π² System.Windows.Forms.Button.WndProc(Message& m) Π² System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) Π² System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) Π² System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Π² System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) Π² System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData) Π² System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) Π² System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) Π² System.Windows.Forms.Application.Run(Form mainForm) Π² AudioMax.Program.Main() Π² C:\Users\YMS21\source\repos\AudioMax\AudioMax\Program.cs:ΡΡΡΠΎΠΊΠ° 19 On line 19 swears:
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace AudioMax { static class Program { /// <summary> /// ΠΠ»Π°Π²Π½Π°Ρ ΡΠΎΡΠΊΠ° Π²Ρ
ΠΎΠ΄Π° Π΄Π»Ρ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }