Skip to content

play-sound-and-wait doesn't play full sound when forever button is also running #2

@hnoble32

Description

@hnoble32

windows xp and java 1.7.0_15 and NL 5.0.2

I think there’s a NL bug evident in this NL program (attached) to do with the sound extension.

(it needs two sounds files in the same directory i.e. 1.wav and 2.wav attached).

Please note there is code in all the buttons except the setup button!

The bug seems to be that the sound recordings only sometimes play when you press the “play sound recording” button – but the sound recording always plays if you stop the go button. It’s as though there’s a ‘listener’ to play the sound recording but the listener only listens if the button to play the sound recording is pressed at some stage within a tick (but I am guessing here of course).

As background, what I am trying to do is stop a simulation at various points, ask a question, get an answer, and also provide the option for the player to listen to a voice recording of the message.

don't think i can attach an NL program here so:

extensions [ sound ]
globals [ question-id ]
to setup
  crt 1
  output-print "hello netlogo"
end
to go
  ask turtles [ fd 1 rt 30 - random 55 ]
end

to play-sound-recording [ id ]
  sound:play-sound-and-wait word id ".wav" 
end

buttons:
setup 
go
out-box
play sound recording: play-sound-recording question-id

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions