Hi;
I don't know where the problem is occurring, but I'm trying to use the DirectX SDK to play an MP3 file. My code is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX;
using Microsoft.DirectX.AudioVideoPlayback;
namespace Media_Player
{
class Program
{
static void Main(string[] args)
{
Audio a = new Audio("Ozzy.mp3");
a.Play();
Console.ReadKey();
}
}
}
I get errors at runtime. First of all, I'm using Visual Studio 2010, and when I go to add the reference to the DirectX dlls, it doesn't show up in the .NET references (I add them by going to C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\).
I get a FileLoadException error: "Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."
I'm assuming this is because I'm running an old version of DirectX? But I've also tried running the same code in Visual Studio 2008. The DirectX dlls show up in the .NET references in 2008, and I can add them, but I get a BadImageFormatException saying "is not a alid Win32 application. (Exception from HRESULT: 0x800700C1)". I have been going crazy, looking everywhere to try and find a solution. I've tried running on different computers and everything,
I just don't know what's going wrong. If anyone can help, I'd be very grateful.
Thanks in advance!