dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.75k forks source link

Cross-platform replacement for SoundPlayer for playing audio across devices/paltforms #27450

Open Petermarcu opened 6 years ago

Petermarcu commented 6 years ago

@jjgriff93 commented on Thu Sep 20 2018

Cannot play sound files as part of .net core console apps in windows and running on windows IoT Core on Raspberry Pi due to lack of audio support. Third party libraries don't offer any simple solution for playing wav or mp3 streams like the .NET Framework SoundPlayer does.

Petermarcu commented 6 years ago

@richlander

karelz commented 6 years ago

@jjgriff93 what are the scenarios where it is needed? What kind of apps would benefit from the APIs? I assume the API is System.Media.SoundPlayer

synercoder commented 5 years ago

@karelz I wish to create a "digital assistent" in a windows console app (perhaps later hosted on a raspberry pi). That uses Azure services for text-to-speech for the responses. Currently I can't do this in netcore. So that is one scenario example.

keithn commented 5 years ago

is this going to be in .net core 3?

karelz commented 5 years ago

No, it is in Future milestone. Also note that there is fairly small interest from community (4 people so far).

mdisg commented 5 years ago

Would be very helpfull to get something like the SoundPlayer provides for windows but universal for other platforms like linux using alsa. We use .NET Core on a embedded device which regulary has to play some short sounds. Bringing up a command line utlity like aplay is not that good in performance.

ericstj commented 4 years ago

cc @joperezr since this has IOT implications.

joperezr commented 4 years ago

in dotnet/iot repo we have this issue which has some overlap: https://github.com/dotnet/iot/issues/287

davidbitterlich commented 5 months ago

This issue is now almost 6 years old. As I've seen, there is now System.Media.SoundPlayer in dotnet 8 (don't know when it was introduced)... However it's Windows-only (System.Windows.Extensions). That's very sad.

Are there still plans, to create a cross-platform equivalent (or to make the namespaces with its classes truly cross-platform) or is the idea already dead?

It would be great to have sound support for some projects and the old mono framework had a working implementation based on Alsa(?), even with SystemSounds implementation.

a6754z commented 1 day ago

Is there any replacement for System.Media.SoundPlayer?