首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >声音播放半秒后就停止了?

声音播放半秒后就停止了?
EN

Stack Overflow用户
提问于 2015-01-25 07:26:49
回答 1查看 380关注 0票数 1

当我单独播放声音文件(在界面中)时,它工作得很好,并且一直播放到最后。然而,当我把它作为代码的一部分(后面跟着一个动作)播放时,它只播放前半部分。我使用的是sound:play-sound and-wait,所以我不确定为什么它不能工作。

代码语言:javascript
运行
复制
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 

这是两个不同的芭蕾舞演员面对不同的方向。当你在它们之间切换时,它们看起来像是在旋转。她一直这样,直到你让她停下来

代码语言:javascript
运行
复制
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

任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

发布于 2015-01-27 12:06:31

听起来像http://github.com/NetLogo/Sound-Extension/issues/2http://github.com/NetLogo/Sound-Extension/issues/3。我认为还没有人调查或尝试解决这些问题。我认为我们甚至不知道它们在什么情况下会发生或不会发生。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28131450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档