简体   繁体   English

System.Media.Soundplayer 不是命名空间? (苹果)

[英]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;我正在尝试在 c# 中播放声音,但没有一个 System.Media 命名空间在工作,而是给出错误: Error CS1069: The type name 'SoundPlayer' could not be found in the namespace 'System.Media'我是正在using System.Media; but it still gives the error.但它仍然给出错误。

The SoundPlayer class provides a simple interface for loading and playing a.wav file. SoundPlayer class 提供了一个用于加载和播放.wav 文件的简单界面。 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. SoundPlayer class 支持从文件路径加载.wav 文件、URL、包含.wav 文件的Stream 或包含.wav 文件的嵌入式资源。

It is for.Net Framework and not for.Net Core.它适用于 .Net Framework 而不是适用于 .Net Core。 Essentially, all of the sound-playing functionality that was available in .NET Framework was Windows-specific;本质上,.NET 框架中可用的所有声音播放功能都是特定于 Windows 的; therefore none of it made it into .NET Core.因此,它们都没有进入 .NET 核心。

For more information you can check SoundPlayer Class in Microsoft.Net Framework documentation.有关详细信息,您可以查看 Microsoft.Net Framework 文档中的SoundPlayer Class

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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