userda
userda

Reputation: 625

Playing media from byte stream in .net

I am developing application that receives media content(.mp3/.mp4/.avi) in form of bytes.
However, as WPF doesn't support playing media from stream, So I started with WMP.dll.
I am creating class library that receives media in form of bytes and media format and play media accordingly.
Referring Creating the WMP Programmatically, however, I didn't find method to pass bytes stream.

So My question is how do I play media from bytes using wmp.dll?

Edit: I am using WMP.dll using COM located at C:\WINDOWS\system32\wmp.dll

Upvotes: 1

Views: 2069

Answers (1)

Jammer
Jammer

Reputation: 10208

I've been through this process a long time ago ...

Basically I would advise you NOT to go down the WMP route at all. It's heavy, cumbersome and not very nice to work with. I encountered lots of issues along the way basically. Least of all it being feature rich (which it isn't).

The best solution I found and the one I'm still using now is a library called BASS from Un4SeenDevelopments.

This library is tiny < 100k and basically it's awesome. Never had a problem with it and it has it's own .NET wrapper that is a free download from the site.

The support is amazing and the compatibility via a massive selection of plugins and additional libraries is staggering.

Highly recommended for what you want to do.

"BASS is an audio library for use in software on several platforms. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via OS codecs and add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions. All in a compact DLL that won't bloat your distribution."

Upvotes: 1

Related Questions