Better sound

What's problem you are encountering?
I can't pause or stop sounds
What have you tried that didn't work?
This is a feature request. I could probably make a snap mod, but I really don't understand how snap handles sounds, and I think it is clear enough for people to read it.

In Snap!, there is no way to pause or stop a sound. This suggestion is an idea of a simple way to add both. My suggestion is to make the play sound block a reporter that returns a ring which will stop it playing, and add an input for where to start. To stop sounds with this would be very simple: start all sounds from 0, and save the ring in a variable. To pause is slightly harder, but not much. Simply make a timer when the sound is started, possibly combine it with the stop ring using a list, and save its value when you pause. To pause, save the value of the timer, and stop the sound. To resume, start the sound from the time from the timer.

Shouldn't this be in the feature requests category?

Woah! now it's not in a category at all! I think...could be a weird glitch..

i support this

Doesn't seem to be working for me..
image
And I did get the javascript correct before you ask:
image

I see the problem: it only works with a sound object, but you're giving it a string.
The Audio Comp library has [scratchblocks] (sound named [ v] :: sensing) [/scratchblocks], which would make it work.

Ah, okay. Thanks!

how do we get the current time a sound is at?

s.audio.currentTime

doesn't work

edit: nvm, I just forgot to make it return the value

now I want to know if a sound is paused.

i agree with this, but i also dont. i think there should be a [start sound [sound] from (min:secs:possiblyMillisecs)]

How do we make it an object rather than a string? I’m new to snap, and I have the same issue that you brought up.

here's how to


note: this block is in the audio comp library.

Okay, so after creating the block, my Sensing section is now a black screen. I can't drag out any of the blocks, nor can I delete the block through the search function. I have tried reloading the project to no avail. Is there anything I can do about this without wiping the project?

that, is weird. Try loading the audio comp library, file > libraries > audio comp > import

i remember someone encountered the same bug-- creating a block with a weird name would make the category that block belonged to a black screen

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.