Audio 声音播放半秒钟然后停止?
当我自己播放声音文件(在界面中)时,它工作良好,一直播放。但是,当我把它作为代码的一部分播放时(后面跟着一个动作),它只播放前半秒。我使用的是声音:播放声音然后等待,所以我不知道为什么它不工作Audio 声音播放半秒钟然后停止?,audio,netlogo,Audio,Netlogo,当我自己播放声音文件(在界面中)时,它工作良好,一直播放。但是,当我把它作为代码的一部分播放时(后面跟着一个动作),它只播放前半秒。我使用的是声音:播放声音然后等待,所以我不知道为什么它不工作 extensions [sound] ; I have them in the same folder to-report mouse-up? ifelse mouse-down? [report "false"] [report "true"] end to twirl if
extensions [sound] ; I have them in the same folder
to-report mouse-up?
ifelse mouse-down?
[report "false"]
[report "true"]
end
to twirl
if mouse-up?
[ask turtles with [shape = ballerina]
[set shape ballerina-2
twirl]
ask turtles with [shape = ballerina-2]
[set shape ballerina
twirl] ]
end
这是两个不同的芭蕾舞演员面对不同的方向。当你在它们之间切换时,它们看起来像在旋转。她一直这么做,直到你让她停下来
to ballet-box
ask patches [set plabel-color 105] ;gives the background this color
sound:play-sound-and-wait "love.aif" ;this works perfectly fine in interface
twirl ;and then I want the ballerina to twirl until you make her stop
end
任何帮助都将不胜感激 听起来像是或。我认为还没有人调查或试图解决这些问题。我认为我们甚至不知道在什么情况下它们会发生或不会发生 请提供一些代码来演示如何播放音频