I dowloaded Mp3MediaStreamSource demo on http://archive.msdn.microsoft.com/ManagedMediaHelpers but can get it worked with my stream, can you help me?
my stream:
private static string mediaFileLocation = "http://server2.fmstreams.com:8011/spin103";
In case 1 is RequestCallback not called:
request.AllowReadStreamBuffering = true;
IAsyncResult result = request.BeginGetResponse(new AsyncCallback(this.RequestCallback), null);
In case 2 is RequestCallback called but I'm getting error: Read is not supported on the main thread when buffering is disabled.
request.AllowReadStreamBuffering = false;
IAsyncResult result = request.BeginGetResponse(new AsyncCallback(this.RequestCallback), null);
You need to read the header in a different thread.
Some .MP3 files don't have a MP3 header right after a ID3 header (for example the ones that I got as sample music with Windows 7). Mp3MediaStreamSource does not work for those files. You can try scanning for the next
FF FB
bytes, however I'm not sure how robust this solution would be.