我该如何开始提示音,并让它运行下去直到我明确地阻止它? [英] How do I start a tone and let it run indefinitely till i stop it explicitly?

查看:159
本文介绍了我该如何开始提示音,并让它运行下去直到我明确地阻止它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图写我的孩子钢琴应用程序。什么我做的是使用一个WinForm里面的KeyDown和KeyUp事件。这样做是为了启动通过在KeyDown事件扬声器冒落的频率,然后停止其在KEYUP事件。就像在钢琴:)

I am trying to write a Piano application for my kid. What I am doing is using KeyDown and KeyUp Events inside a WinForm. The idea is to start emiting a frequency through the speaker in KeyDown event and then stop it in Keyup event. Just like in a piano :)

不过,这是与音频或视频什么我的第一dabling。那么,有没有办法做到这一点? IZ有没有更好的办法做我的建议。请注意,我没有使用MIDI或WAV文件或任何类似。因此,我不能开始使用的样本,让我这样做。另外请注意,我打算去的不仅仅是钢琴频率。

However, this is my first dabling in anything with Audio or Video. So, Is there a way to do it? Iz there a better way to do what I am suggesting. Note that I don't have access to midi or wav files or anything similar. Hence I can't start using samples that allow me to do this. Also note that I plan to go for more than just Piano frequencies.

此外,这还只是一个孩子玩得开心(谁是只有15个月大的:)) 任何帮助是AP preciated。

Again, this is just for a kid to have fun (who is just 15 months old :)) Any help is appreciated.

推荐答案

尝试寻找这些物品。

  1. 声音的基础知识:如何让音乐出什么都没有

声音发生器 - 如何利用数学创造外星人的声音 公式

Sound Generator – How to create alien sounds using mathematic formulas

音频-Real低水平声音生成的C#?

这篇关于我该如何开始提示音,并让它运行下去直到我明确地阻止它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆