Lib for playing audio in .NET?

I tried fmod.net but got the error "System.BadImageFormatException". Then I tried WindowsMediaPlayer and played the sounds. However, I am having trouble playing the sound when the current one ends (the callback code is below. I don't seem to like it when I play a new song during a state change, but I cannot find another way to tell me when the song will be completed) and using this link I managed to get a title, but not a performer, album, etc.

Which lib can I use to play sound (mp3, m4a and I would like ogg and aac). I searched for FFMPEG.NET and found a project without a release, and the other one was fflib, which seems to only do conversions (and also has a bad image exception). What can i use? or How to get the name / artist / etc in WMPLib.WindowsMediaPlayer and make it play another song when it ends (I don’t want to add a playlist inside WMP. I would like to save it and just get a notification when the song ends for further action).

    private void Player_PlayStateChange(int NewState)
    {
        var newState = (WMPLib.WMPPlayState)NewState;
        Console.WriteLine(newState);
        //if (newState == WMPLib.WMPPlayState.wmppsMediaEnded)
        if (newState == WMPLib.WMPPlayState.wmppsStopped)
        {
            next();
        }
    }
+3
source share
3 answers

Have you tried Bass.Net ?

+1
source

"System.BadImageFormatException" . x86, x86, CPU (, x64).

+4

You can use NAudio in Codeplex.

+2
source

Source: https://habr.com/ru/post/1732770/


All Articles