Music player with Play/Pause and Seek

  scripts
  sprites
See inside
Notes and Credits

Drag the variable slider to seek. Press Pause to pause. Press Play to play.

So I made a music player with play/pause and seek functions, yay :D

The audio quality isn't the absolute best but whatever, this is Scratch. :P

Scratch does not have a built in way to pause/resume/seek or anything, so I wrote a small script using python, kurt and pydub to split the audio file into chunks of arbitrary size (for this example I used 500ms) and import them all into a big scratch project. If you're interested, you can find the script at https://github.com/TheInitializer/sb2-soundsplit

I originally tried 250ms but there was a noticeable delay in between the audio chunks due to Scratch's slowness so I increased to 500ms. More time means less delay (which shouldn't really be noticeable over 500ms) but more time for the pause button to respond after you click it. 500ms works well.

I then wrote a small script in scratch that basically loops through all the 400ish little sound files and plays them one at a time. If it's paused it just remembers where it left off (via the "index" variable) and resumes when you click Play.

Hope you enjoyed this! Sorry if it takes a while to load :P

Demo song: Vexento - Happiness
Thanks to
- @blob8108 for making kurt
- @blob8108 (again) for helping me when it didn't work
- whoever made pydub for making pydub (it's an awesome library)

Shared: 25 Jan 2017 Modified: 25 Jan 2017
Favorite this project 11
Love this project 19
Total views 105
View the remix tree  2
  
More projects by __init__