简体   繁体   中英

C# winform, App Crashing after using the Video/Audio classes from the Microsoft.DirectX.AudioVideoPlayback dll

I'm working with some Audio files in my app (mp3, wav, ..etc) I was using the Audio Class from the Microsoft.DirectX.AudioVideoPlayback dll so first I had to download the dll, after doing so, I went to Add Reference then I browsed to the dll location, and added it I also installed the DirectX 9.0 Web Setup

Now, i don't get any problem with just saying: Audio aud; but if I do something like this:

Audio aud = new Audio(path);

or

Video vid = new Video(path);

if I press Ctrl+F5 the app will crash immediately, If i try to debug, I just can't see the debugging cursor, and if i keep pressing F10 nothing ever happens .. I put it in a try/catch block, it didn't threw an exception ..

so what's goin on ? how can i fix this ?

I even tried to make a whole new app, here's the whole code, there's nothing really in it:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.DirectSound;
using Microsoft.DirectX.AudioVideoPlayback;
using Microsoft.DirectX;

namespace WindowsFormsApplication2
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
      Audio aud = new Audio("C:\\Users\\vexe\\Desktop\\Songs\\Kimosabe.mp3");
    }
  }
}

Any help would be appreciated .. Thanks in advance ..

add this code to your project:

using Microsoft.DirectX.DirectSound
using Microsoft.DirectX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM