简体   繁体   中英

System.Media.Soundplayer not a namespace? (mac)

I'm trying to play sounds in c#, and none of the System.Media namespacese are working, instead giving the error: Error CS1069: The type name 'SoundPlayer' could not be found in the namespace 'System.Media' I'm am doing using System.Media; but it still gives the error.

The SoundPlayer class provides a simple interface for loading and playing a.wav file. The SoundPlayer class supports loading a.wav file from a file path, a URL, a Stream that contains a.wav file, or an embedded resource that contains a.wav file.

It is for.Net Framework and not for.Net Core. Essentially, all of the sound-playing functionality that was available in .NET Framework was Windows-specific; therefore none of it made it into .NET Core.

For more information you can check SoundPlayer Class in Microsoft.Net Framework documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM