向程序C#添加声音?

编程入门 行业动态 更新时间:2024-10-20 01:22:53
本文介绍了向程序C#添加声音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个使用c#的项目,我想在程序中添加声音.该程序具有标签排列功能,可模拟布局算法.那么,如何更改发出声音的标签?希望大家帮忙!

I have a project with c #, I want to add sound to my program. The program features the label permutations to simulate the layout algorithms. So how do you change the label where the sound is called out? Hope everyone help! thanks!

推荐答案

方法很少.这完全取决于您需要哪种声音. 您需要文字转语音吗?使用程序集System.Speech,请参见System.Speech.Recognition: msdn.microsoft. com/en-us/library/system.speech.recognition.aspx [ ^ ]. 您需要播放媒体文件吗?这也是可能的: 在WinForms应用程序中嵌入和播放WAV音频文件 [ ^ ], nBASS:.NET的声音库 [ ^ ], 适用于Windows 7的MP3播放器 [ ^ ]. 您还可以使用P/Invoked MIDI接口: C#MIDI工具包 [ ^ ], WPF Midi乐队 [ ^ ]. 您还可以即时合成波形,播放不同类型的媒体等. 参见: C#中的低级音频播放器 [ ^ ], 吸引声音 [ ^ ], 在C#中编程音频效果 [ ^ ]. 这只是CodeProject上大量文章的一小部分. 您到底想要什么? Google为它找到了许多可能性.
—SA
There are few approaches. It all depends on what sound do you need. Do you need text-to-speech? Use the assembly System.Speech, see System.Speech.Recognition: msdn.microsoft/en-us/library/system.speech.recognition.aspx[^]. Do you need to play media file? This is also possible: Embedding and Playing WAV Audio Files in a WinForms Application[^], nBASS: A sound libary for .NET[^], MP3 Player for Windows 7[^]. You can also use P/Invoked MIDI interface: C# MIDI Toolkit[^], WPF Midi Band[^]. You can also synthesize waveforms on the fly, play different types of media, etc. See: A low-level audio player in C#[^], Draw into sound[^], Programming Audio Effects in C#[^]. This is only a small fraction of the wealth of articles available only on CodeProject. What exactly do you want? Google for it to find many possibilities.
—SA

更多推荐

向程序C#添加声音?

本文发布于:2023-11-07 06:09:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565744.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:声音   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!