如何一个接一个地播放两个或多个音频文件而不冻结表格? [英] How to play two or more audio files one after another without freezing the form?

查看:72
本文介绍了如何一个接一个地播放两个或多个音频文件而不冻结表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个小程序,其中需要一个接一个地播放两个或多个文件。


这是我的BAS模块中的声明:

I have written a small program in which playing two or more files one after another is needed.


This is the Declaration in my BAS Module:

展开 | 选择 | Wrap | 行号

推荐答案

让我更清楚。我希望先后运行一些命令。例如,如果运行以下代码,则无法在 第1行 Label1 的值>代码,因为程序运行下一行并在音频文件播放完毕之前立即更改其值:
Let me be more clear. I wish to run some commands successively. For example, if you run the following code, you can''t see the value of Label1 in Line 1 of the code, because the program runs the next lines and changes its value immediately before the audio file finishes playing:
< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


老实说,VB6和Windows / WMP中的内置音频很糟糕。如果您想使用非阻塞的音频功能(即 - 在播放时不会冻结您的程序),我强烈建议您查找FMOD 3.7x的副本。不幸的是,他们不再提供这个从他们的网站下载。我会在一些备份光盘上四处看看,看看我是否能找到你一段时间后退的光盘。


编辑:找到它: FMOD 3.75
Honestly, the built in audio in VB6 and Windows/WMP just suck. If you''re wanting to use audio functions that are nonblocking (ie - won''t freeze your program while they are playing) I would HIGHLY recommend finding a copy of FMOD 3.7x. Unfortunately, they don''t offer this as a download from their website anymore. I''ll look around on some backup discs and see if I can find you one I downloaded a while back.

Found it: FMOD 3.75


只是一个注释 - DoEvents 用于简单地中断VB代码,使Windows有机会做其他事情。一个例子可能是做了很长的计算,其中涉及大量的循环。在这种情况下,你的代码无法控制,这不太可能产生太大影响。
Just a note - DoEvents is used to interrupt your VB code briefly, to allow Windows a chance to do other things. An example might be doing a really long calculation which involves a lot of looping. It''s unlikely to have much effect in a case like this, where your code doesn''t have control.


这篇关于如何一个接一个地播放两个或多个音频文件而不冻结表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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