gpt4 book ai didi

c# - 如何在.NET Compact Framework 2.0 中播放感叹号或星号音?

转载 作者:太空宇宙 更新时间:2023-11-03 14:34:04 25 4
gpt4 key购买 nike

我想为用户创建声音反馈,以表示数据验证成功或失败。播放系统星号和感叹号声音似乎是执行此操作的正确方法,特别是因为设备可能配置了非标准声音。

问题是 .NET Compact Framework 2.0 中无法使用 System.Media 来播放它们。

我有哪些替代方法可以播放这些系统声音?

最佳答案

using System.Runtime.InteropServices;

[DllImport(”winmm.dll”)]

private static extern bool PlaySound( string filename, int module, int flags );

PlaySound(Application.StartupPath + "/test.wav",0,SND_ASYNC);

关于这个here有一整篇文章

关于c# - 如何在.NET Compact Framework 2.0 中播放感叹号或星号音?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1770235/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com