如何同时播放多种声音 [英] How to play many sounds at the same time

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

问题描述

你好
我想同时播放许多声音,每种声音都独立于其他声音,我知道我必须使用Thread,但我不知道该怎么做?
如果您尝试在不同的线程中播放不同的声音,则在最佳情况下,每次出现的声音都是随机的.您没有使用实时系统.对于人耳来说,缺少音频同步是否清晰并造成非常不好的印象(除非您想产生随机噪声).

异步操作也是如此.您应该真正避免异步操作,因为您可以使用线程,这样更易​​于实现且更强大.

如果您不想产生这种噪音,则必须预先混合音频并播放混合音频.使用某些音频混音软件,或者由您自己做.

—SA


我认为我们可以使用Asyn通话来同时播放不同的声音.


Hello
I want to play many sounds at the same time every sound is independant from others i know that i have to use Thread but i dont know how ?
thanks

解决方案

If you try to play different sounds in different threads, in the very best case the sounds will come our with random timing each time. You''re not working with real time system. To a human ear, lack if audio synchronization will be clear and create very bad impression (unless you want to generate randomized noises).

Same thing with asynchronous operations. You should really avoid asynchronous operations as you can use threads, which is easier to implement and more robust.

If you don'' want to create such noise, you have to pre-mix you audio and play a mixed audio. Use some audio-mixing software or do you by yourself.

—SA


I think we can use Asyn call to play different different sounds at a same time.


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

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