[SOLVED] Can I stop the song and the make it play again from the point it was stopped?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Nanahs
Veteran
Posts: 297
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

[SOLVED] Can I stop the song and the make it play again from the point it was stopped?

#1 Post by Nanahs » Mon Sep 03, 2018 1:09 pm

I mean, I wanted to simulate a radio. I'm using hotspots and screens.
The scene would have the "play song "music.mp3" "
I wanted to make a hotspot where the radio button is, with the function of making the song stop. And when the person clicks there again, the song would start playing again from where the player stopped before. I wouldn't play from the beginning again.
Is that possible to make?

Thanks xx
Last edited by Nanahs on Thu Sep 27, 2018 6:00 pm, edited 2 times in total.

User avatar
MaydohMaydoh
Regular
Posts: 101
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: Can I stop the song and the make it play again from the point it was stopped?

#2 Post by MaydohMaydoh » Mon Sep 03, 2018 2:03 pm

Use the PauseAudio action
https://www.renpy.org/doc/html/screen_a ... PauseAudio

Code: Select all

textbutton "Play/Pause" action PauseAudio('music', value='toggle')

User avatar
Nanahs
Veteran
Posts: 297
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: Can I stop the song and the make it play again from the point it was stopped?

#3 Post by Nanahs » Thu Sep 06, 2018 9:51 am

Thank you so much! It worked :)

Post Reply

Who is online

Users browsing this forum: gas, SwashbucklerXX