Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write an implementation of IPlayer for Linux or Mac #8

Open
markjamesm opened this issue Oct 31, 2020 · 3 comments
Open

Write an implementation of IPlayer for Linux or Mac #8

markjamesm opened this issue Oct 31, 2020 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@markjamesm
Copy link
Owner

MusicSharp currently isn't cross-platform, but the player class is loosely coupled to the cross-platform GUI by using Dependency Injection (DI). Currently, the GUI class injects the Winplayer class through constructor injection to handle audio processing via the Windows-only NAudio library.

Conceivably, one could write a Linux or MacOS player class which conforms to the IPlayer interface using a cross-platform C# audio library such as Bassoon.

@markjamesm markjamesm added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 31, 2020
@marijnz0r
Copy link
Contributor

I tried to use Bassoon for the Linux version, but the problem is this:

libsndfile doesn't support MP3 reading (due to patent concerns), so it isn't supported at the moment. It should be added soon enough to Bassoon
IIRC, the patents did expire, so it's possible that MP3 decoding may be added to libsndfile in the near future.

Check http://www.mega-nerd.com/libsndfile/FAQ.html#Q020 as well.

See libsndfile/libsndfile#258 for the issue.

See libsndfile/libsndfile#499 for the pull request.

@markjamesm
Copy link
Owner Author

I also tried creating a cross-platform branch to test using SharpAudio for the cross-platform library:

https://github.com/markjamesm/MusicSharp/tree/cross-platform

Basic audio playback works on Windows (with some bugs) but attempting to play a file in Linux and Mac causes a crash.

@markjamesm
Copy link
Owner Author

According to this this comment by Mark Heath (creator of the NAudio library):

I am in discussions with someone who has offered to contribute a Linux IWavePlayer implementation which would be a great addition to NAudio.

So hopefully this means Linux audio support sometime in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants