播放声音播放使用多个声音 [英] Play multiple sounds using SoundPlayer

查看:186
本文介绍了播放声音播放使用多个声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做采样方案,其中从1到9的每个键会做出不同的声音。 一切工作正常,但是当我preSS两个(或更多)的声音在同一时间,第二个杀的第一个。

I'm making a sampler program where each key from 1 to 9 will make a different sound. Everything works fine, but when I press two (or more) sounds at the same time, the second one "kills" the first one.

我是从.WAV文件播放声音,使用声音播放。我该如何解决这个问题?

I'm playing the sounds from .WAV files, using SoundPlayer. How can I solve this?

推荐答案

您需要使用DirectX(DirectSound的),或者被设计成允许多种声音的播放,同时一些类似的API。

You'll need to use DirectX (DirectSound) or some similar API that is designed to allow the playing of multiple sounds at the same time.

这篇关于播放声音播放使用多个声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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