locked
Using Media Foundation in C# RRS feed

  • Question

  • Hi,

     

    I have a C# project where I've been using the MediaElement class to play mp3 files. However, I now want to support more file formats and thought that Media Foundation would be the way to go. My application is Windows 7 only. I'm using .NET 4.

     

    However, it seems to me that there's no way to use Media Foundation with C#. I found some project on SourceForge which seemed to be abandoned a few years ago.

     

    Any ideas or tips?

    Tuesday, September 14, 2010 12:14 PM

Answers

  • hi there,

     

    the project on sourceforge is not that old. it actually provides just a managed wrapper for the

    MF COM interfaces. i used it successfully in a project with several parallel video sessions.

    however, the mediaelement uses WMP (which itself uses media foundation). if you want

    to supoprt audio formats wmp does not support. i doubt MF would be the way to go

    for you. maybe look for some (maybe purely managed) alternatives. e.g. nBass

    regards

    j. 

    • Marked as answer by Ephracis Tuesday, November 2, 2010 12:14 PM
    Tuesday, September 14, 2010 12:35 PM

All replies

  • hi there,

     

    the project on sourceforge is not that old. it actually provides just a managed wrapper for the

    MF COM interfaces. i used it successfully in a project with several parallel video sessions.

    however, the mediaelement uses WMP (which itself uses media foundation). if you want

    to supoprt audio formats wmp does not support. i doubt MF would be the way to go

    for you. maybe look for some (maybe purely managed) alternatives. e.g. nBass

    regards

    j. 

    • Marked as answer by Ephracis Tuesday, November 2, 2010 12:14 PM
    Tuesday, September 14, 2010 12:35 PM
  • Hi and thanks for the fast response.

     

    I looked at BASS and they had a version for .NET and C#. Downloaded it and ran the setup file. I got the DLL but there was no examples so I have no idea how to use it. No docs on their website either.

     

    I then looked at nBass but I could not build it. When I tried to convert the solution to Visual Studio 2010 I got errors about source control. Then, when I tried to build it I got errors saying it couldn't find bass.dll and basswma.dll (which were indeed missing). I don't think I have any source control components in my Visual Studio. I have never used source control since I use SVN and Tortoise for my projects.

    Tuesday, September 14, 2010 1:44 PM