驻波:无限循环 MP3
如何在 驻波 中无限循环播放 mp3 文件。我尝试过 LoopSource 和 SoundGenerators 等,但我没有运气。我在文档或网上找不到循环 anInfinitely mp3 的人的使用示例:
var player:AudioPlayer = new AudioPlayer()
const generator:SoundGenerator = new SoundGenerator(sound)
source = new LoopSource(new AudioDescriptor(), generator)
player.play(source)
谢谢
How do I infinitely loop an mp3 file in standing wave. I've tried LoopSource with SoundGenerators etc, but I've had no luck. I can find no usage examples in the documentation or online of someone looping anInfinitely mp3:
var player:AudioPlayer = new AudioPlayer()
const generator:SoundGenerator = new SoundGenerator(sound)
source = new LoopSource(new AudioDescriptor(), generator)
player.play(source)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我是该库的作者。由于很多人问这个问题,我在该项目的 github wiki 中添加了一个页面来回答这个问题。
https://github.com/maxl0rd/standwave3/wiki/How-to -use-loopsource
希望有帮助。
I am the lib's author. Since a lot of people ask this question, I've added a page answering this question in the github wiki for the project.
https://github.com/maxl0rd/standingwave3/wiki/How-to-use-loopsource
Hope that helps.
看起来
LoopSource
函数的AudioDescriptor
参数应该与soundGenerator
参数匹配。根据文档,实例化一个新的AudioDescriptor
会将channels
和rate
属性设置为NaN
(即使它们'重新输入uint
??)。无论如何,看看这是否有效:除此之外,AudioPlayer 类包含一个完整事件,该事件在音频源完成播放时调度。您可以简单地使用布尔开关来设置自己的循环,以从完整的处理程序中调用
play(source:IAudioSource)
。it appears that the
LoopSource
function'sAudioDescriptor
parameter should match thesoundGenerator
parameter. according to the docs instantiating a newAudioDescriptor
will set thechannels
andrate
properties asNaN
(even though they're typed atuint
??). anyway, see if this works instead:other than that, the
AudioPlayer
class contains a complete event, which is dispatched when the audio source has finished playing. you could simply set up your own loop using a boolean switch to callplay(source:IAudioSource)
from the complete handler.我一直在尝试使用如何使用loopsource信息这里< /a>.我可以播放声音,但只能循环 3 次。想法?
I have been trying to use the How-to-use-loopsource info here. I am able to play my sound, but it only loops 3 times. Thoughts?
好吧,由于我在尝试根据文档和少量在线帮助循环音频源时遇到了困难,所以我决定创建自己的 Standing Wave 3 插件库。它并不完美,但它可以完成工作,并且是在字节级别上;没有循环计时器或任何东西。它的工作原理是接收带有开始和结束循环点的声音。然后,它根据提供的时间(以秒为单位)多次克隆循环样本。它应该可以直接使用。这是 Main.as 类的代码
“examples”文件夹中的“looping”文件:
在此处查看源文件:
https://github.com/charlesclements/standwave3-addons
OK, since I was having a hell of a time trying to loop an audio source based on the documentation and a thin amount of help online, I decided to create my own Standing Wave 3 addons library. It's not perfect but it gets the job done, and on the byte level for that matter; No loop timers or anything. It works by taking in a Sound with beginning and ending loop points. Then it clones the loop sample a bunch of times based on the time provided in seconds. It should be straight forward to use. This is the code for the Main.as class in the
"looping" file in the "examples" folder:
Check out the source files over here:
https://github.com/charlesclements/standingwave3-addons