question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New stack blocks: Play [sound] from (time) secs and Stop [sound]

See original GitHub issue

Referring to #999, if there is a hat block that detects when a sound reaches a time, I think there should also be a corresponding block: play [sound v] from (time). To complement it, another block would be useful: stop [sound v].

Both of these sounds are pretty self-explanatory - play [sound v] from (time) would play the desired sound from a certain time (maybe in seconds?) and stop [sound v] would stop just that one sound.

On a slightly unrelated note, I’m glad that so many new audio blocks are being added!

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Kenny2githubcommented, Mar 12, 2018

An example of how this could be used (for pausing music):

when gf clicked
set [time v] to [0]
broadcast [start music v]

when I receive [start music v]
reset timer
play sound [music v] from (time)

when I receive [pause music v]
set [time v] to (timer)
stop sound [music v]

Then you would broadcast “pause music” to pause and “start music” to start again.

1reaction
ericrosenbaumcommented, Jul 17, 2017

Sprites can only play a single instance of a particular sound (successive calls to “play sound” restart the sound), so a “stop [sound v]” block would work fine.

I should clarify that #999 etc. are just proposals we’re thinking about, and we’ll hopefully prototype them at some point, but no guarantees. We’re very careful about adding new blocks. That said we appreciate the thoughtful ideas!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Play Sound () Until Done (block)
As this block plays a sound and pauses its script until the sound is done, it is mainly used when a sound must...
Read more >
Bad timing when playing audio files with PyGame
It's like there are pause of 0.2 sec than 0.7 sec then 0.2 sec again, it's very irregular. Notes: I know that time.sleep()...
Read more >
c# - Trying to use yield to wait for a few seconds to avoid ...
I wanted to delay the output of "game over" by 3 seconds. So the explosion is over. Play the 'Game over sound' and...
Read more >
Sonic Pi - Tutorial
If at any time you wish to stop the sound just hit the Stop button. ... Think of it like a big switch...
Read more >
LEGO Education EV3 Classroom Blocks
the sound is finished. Start Sound. Starts playing a selected sound on the EV3 Brick and immediately continues the programming stack. Play Beep...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found