I have inherited from the DirectX class to play audio files.
public class MyAudio : Microsoft.DirectX.AudioVideoPlayback.Audio
public string MyFile;
public MyAudio(string str) : base(str)
public MyAudio(string str, bool bln) : base(str, bln)
In my code:
MyAudio newAudio = (MyAudio) MyAudio.FromUrl("http://web.com/46.mp3", false);
When I run this app it gives an error on the above line:
"Specified cast is not valid" !
The declaration of FromUrl func is :
public static Microsoft.DirectX.AudioVideoPlayback.Audio FromUrl ( System.String address , System.Boolean autorun )
How can I fix this problem ? I need to inherit from this class as I want to save the name of the file this object is playing !