![](/img/trans.png)
[英]c# using Microsoft.DirectX.AudioVideoPlayback how to play next video after one is finished
[英]C# winform, App Crashing after using the Video/Audio classes from the Microsoft.DirectX.AudioVideoPlayback dll
我正在使用我的應用程序中的某些音頻文件(mp3,wav,.. etc),我使用的是Microsoft.DirectX.AudioVideoPlayback dll中的音頻類,因此首先我必須下載該dll,這樣做之后,我去了添加引用,然后瀏覽到dll位置,並添加了它,我還安裝了DirectX 9.0 Web安裝程序
現在,我只說Audio aud;
就沒問題Audio aud;
但是如果我做這樣的事情:
Audio aud = new Audio(path);
要么
Video vid = new Video(path);
如果按Ctrl+F5
則應用程序將立即崩潰;如果嘗試調試,則看不到調試光標;如果繼續按F10鍵,則什么也沒發生..我將其放在try/catch
塊中,它將沒有拋出異常..
那到底是怎么回事? 我怎樣才能解決這個問題 ?
我什至嘗試制作一個全新的應用程序,這是完整的代碼,其中實際上沒有任何內容:
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");
}
}
}
任何幫助將不勝感激..在此先感謝..
將此代碼添加到您的項目中:
using Microsoft.DirectX.DirectSound
using Microsoft.DirectX
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.