Ren'Py is making me nucking futs!

SciGuy

Member
May 8, 2018
167
168
I've been working on a game script for a couple of days and have gone back to 'dress it up' a little.
What I'd like to do next is manipulate the speed the audio files play. I'm using all 3 sound channels, or at least I plan to.
The music channel is fine - There's a background tune that plays in a loop. I'd like to have the volume fade in and out at the start/end of the clip, but I can live with what I've got if need be.
The important stuff is in the voice files. I've pulled some very explicit sounds and voices from a few videos, and want to sync them up with my animations. None of the Ren'PY instructions I've found seem to have any effect.
Once synched, I'll be able to increase/decrease speed of the audio and video at the same time (In a perfect world anyway).
Any gurus out there know what I can do to make this happen?

PLEASE bear in mind I'm in the very early stages of learning Renpy when posting a reply here!
 

Papa Ernie

Squirrel!?
Uploader
Donor
Dec 4, 2016
12,333
48,137
I've been working on a game script for a couple of days and have gone back to 'dress it up' a little.
What I'd like to do next is manipulate the speed the audio files play. I'm using all 3 sound channels, or at least I plan to.
The music channel is fine - There's a background tune that plays in a loop. I'd like to have the volume fade in and out at the start/end of the clip, but I can live with what I've got if need be.
The important stuff is in the voice files. I've pulled some very explicit sounds and voices from a few videos, and want to sync them up with my animations. None of the Ren'PY instructions I've found seem to have any effect.
Once synched, I'll be able to increase/decrease speed of the audio and video at the same time (In a perfect world anyway).
Any gurus out there know what I can do to make this happen?

PLEASE bear in mind I'm in the very early stages of learning Renpy when posting a reply here!
It sounds like it would be easier to edit the sound files with a 3rd party sound editor then use the edited sounds in Ren'py... my $.02.
 
  • Like
Reactions: stevedave83 and bas

SciGuy

Member
May 8, 2018
167
168
I can probably edit them to sync up at one speed, but making the speed adjustable is a little more challenging. I can't find much of anything that controls sound aside from start, stop, and loop. I can't even make them fade in and out.
 

shady31

Member
May 31, 2017
247
1,019
I don't know Ren'py, but that all sounds do-able. This page explains music fade in/out:


Code:
play music [ "a.ogg", "b.ogg" ] fadeout 1.0 fadein 1.0

As far syncing audio with image, I think if you had different sound files, say 75%, 100% and 125% speed you could just play the sound with it's respective animation in a loop however many times. If you have an example of what you're trying to achieve from a different game, I might be able to give more helpful advice.
 
  • Like
Reactions: Papa Ernie

SciGuy

Member
May 8, 2018
167
168
play music [ "a.ogg", "b.ogg" ] fadeout 1.0 fadein 1.0
I've been using mp3's. Is there a benefit to using ogg? I'm pretty sure one of my audio converters can handle that. Also, is the renpy syntax the same for mp3 and ogg files? I'll play around with the fadein/fadeout commands some more. I need those transitions to happen when the page is advanced. I haven't had any luck with them yet, but I'm sure it's operator error.

I don't have any examples, but I like the idea you presented. I was planning to make the speed adjustable by a slider. I can instead sync the files at 3 different speeds and record each as its own short, looped gif. Add a couple of selector buttons to the GUI and I'm golden! Working with the GUI is very foreign to me, but it's something I need to learn.

I've got half a dozen or so audio editors, one of em is bound to have the ability to control playback speed. I know for a fact I can replace the modded audio files with Movie Maker.

All in good time. I've got the game intro script about 75% complete, and most of the still images done. The stupid game is NOTHING like what it started out to be, but I like what it's becoming much better than the original plan. The re-writing has kinda sucked tho!

The next few days will be tied up by figuring out how to control pauses between image switching, and using transitions properly to simulate animation. I THINK I can set all the animations up with label commands, and call them with a jump statement.
 

shady31

Member
May 31, 2017
247
1,019
I've been using mp3's. Is there a benefit to using ogg? I'm pretty sure one of my audio converters can handle that. Also, is the renpy syntax the same for mp3 and ogg files?
An ogg file will be a little smaller than the equivalent quality mp3 file, but mp3 is more widely used, so you're probably better off sticking with that. That was just an example that I pasted off the webpage. And yes the syntax is the same, the above statement actually plays two files. Yours should look like so (with the time adjusted to whatever you'd like):

Code:
play music "your_song_name_here.mp3" fadeout 1.0 fadein 1.0
You might want to check out for ideas and technical help, there's a section on Ren'Py. Just be careful not to post anything NSFW, it's not that kind of forum.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,566
7,384
If you're looking to tightly sync audio with animations, your best bet is to prepare the animation as a video, and then arrange for your audio to be the sound track on that animation video. Any other approach isn't going to guarantee that the audio and video stay synced across various people's computers with different drivers, lags, etc.