Why don't ren'py use pygame.mixer?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
akakyouryuu
Regular
Posts: 153
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Why don't ren'py use pygame.mixer?

#1 Post by akakyouryuu » Thu Aug 15, 2013 9:10 pm

I tried to add ren'py the function that plays music from a certain position and found ren'py doesn't use pygame.mixer, but use sdl directly.
What is the reason not to use pygame.mixer or sdl_mixer?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Why don't ren'py use pygame.mixer?

#2 Post by PyTom » Fri Aug 16, 2013 12:25 am

SDL_Mixer doesn't support the types of sound files we want to support on multiple channels. This was especially true in the past, when WAVs were the only supported format. Writing our own code also allows for us to seamlessly switch between multiple segments of a song.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
akakyouryuu
Regular
Posts: 153
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Why don't ren'py use pygame.mixer?

#3 Post by akakyouryuu » Sat Aug 17, 2013 10:41 pm

OK. I will try to do by ffmpeg.
I found av_seek_frame at 1427 in ffdecode.c, but I was unable to find that int64_t start_time was changed since it had been declared at 200 in that file. What case is this code executed in?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Why don't ren'py use pygame.mixer?

#4 Post by PyTom » Sun Aug 18, 2013 9:28 am

akakyouryuu wrote:OK. I will try to do by ffmpeg.
I found av_seek_frame at 1427 in ffdecode.c, but I was unable to find that int64_t start_time was changed since it had been declared at 200 in that file. What case is this code executed in?
It likely isn't executed - the ffdecode.c code was derived from ffplay, which had some functionality (keyboard-based seeking, subtitles, etc) that Ren'Py doesn't take advantage of.

My current thinking is that I'd be unlikely to merge a music-seeking patch with Ren'Py, as it would also need to be ported to Android (which uses a totally different playback system), and it doesn't really add much functionality over cutting a track up into chunks, and playing/queueing those chunks.

Do you have a use case that needs seeking?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
akakyouryuu
Regular
Posts: 153
Joined: Fri Nov 30, 2012 10:29 am
Contact:

Re: Why don't ren'py use pygame.mixer?

#5 Post by akakyouryuu » Sun Aug 18, 2013 9:34 pm

I wanted to add a MusicRoom a seek bar like below.



It can show the current position, but can't change the position by the bar.
I doesn't pull request this if that lets ren'py to lose the compatibility for android.

Post Reply

Who is online

Users browsing this forum: No registered users