如何支付多声音 [英] How to pay multi sound
本文介绍了如何支付多声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
using Microsoft.DirectX.AudioVideoPlayback;
public static void playNote (string pass)
{
Audio myAudio = new Audio(pass);
myAudio.Play();
}
我的虚拟钢琴已经有了这种方法
当我按下按钮
i ve got this method for my virtual piano
when i press button
playNote("PianoDo#.wav");
但是如果我按下很多按钮30秒钟,我的应用由于CPU而开始滞后
还有另一种更轻巧的方法吗?还是从流中播放了几种声音?
but uf i press a lot of buttons for 30 sec my app starts lagging because of CPU
Is there another method which is lighter?Or playing several sounds from stream?
推荐答案
看看这个 ^ ].播放wav文件肯定会降低性能.
Take a look at this article[^]. Playing wav files will surely reduce the performance.
我的意思是不播放midi,而是如何播放资源中的文件以使声音不会互相干扰,
i mean not to play midi,but how to play files from resources so that sounds will not iterrupt each other,
这篇关于如何支付多声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文