当我单独播放声音文件(在界面中)时,它工作得很好,并且一直播放到最后。然而,当我把它作为代码的一部分(后面跟着一个动作)播放时,它只播放前半部分。我使用的是sound:play-sound and-wait,所以我不确定为什么它不能工作。
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任何帮助都将不胜感激!
发布于 2015-01-27 12:06:31
听起来像http://github.com/NetLogo/Sound-Extension/issues/2或http://github.com/NetLogo/Sound-Extension/issues/3。我认为还没有人调查或尝试解决这些问题。我认为我们甚至不知道它们在什么情况下会发生或不会发生。
https://stackoverflow.com/questions/28131450
复制相似问题