renpy.sound.play() doesn't work on 7.3.2

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
Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

renpy.sound.play() doesn't work on 7.3.2

#1 Post by Ivlivs »

When I try to use renpy.sound.play() in a program, the sound doesn't play at all. The last release I know of where it does work is 7.2.2, so I use that instead.

To be specific, renpy.sound.play() fails when I use the <from A to B> syntax to play only part of a sound file. It works just fine in 7.2.2.
Jitteh Dawn --- A VN by Ivlivs

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#2 Post by namastaii »

You would use

Code: Select all

 play sound "soundfile.mp3"
instead

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: renpy.sound.play() doesn't work on 7.3.2

#3 Post by PyTom »

Please file a bug on the Ren'Py tracker, with the files in question attached. I don't know anything that would have changed, but I'd like to handle this when I get a chance.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#4 Post by Imperf3kt »

namastaii wrote: Thu Aug 08, 2019 10:53 pm You would use

Code: Select all

 play sound "soundfile.mp3"
instead
renpy.sound.play() would be used wherever a screen action or python function is required. I assume this is one of these cases.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#5 Post by IrinaLazareva »

Honestly, I'm surprised this method worked in version 7. This function has been obsolete for a long time. You can use renpy.music.play() instead.
https://renpy.org/doc/html/audio.html#renpy.music.play
For example,

Code: Select all

$ renpy.music.play("example.ogg", channel='sound', loop=None)

Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#6 Post by Ivlivs »

IrinaLazareva wrote: Fri Aug 09, 2019 4:51 am Honestly, I'm surprised this method worked in version 7. This function has been obsolete for a long time. You can use renpy.music.play() instead.
https://renpy.org/doc/html/audio.html#renpy.music.play
For example,

Code: Select all

$ renpy.music.play("example.ogg", channel='sound', loop=None)
I tried that just now; it didn't work.
Jitteh Dawn --- A VN by Ivlivs

Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#7 Post by Ivlivs »

PyTom wrote: Thu Aug 08, 2019 11:07 pm Please file a bug on the Ren'Py tracker, with the files in question attached. I don't know anything that would have changed, but I'd like to handle this when I get a chance.
Done -- I've filed the bug report under the name RawleNyanzi, and I even attached a project folder containing the code and assets for an example program that illustrates the issue. To make it easy to switch between 7.3.2 and 7.2.2, it's not an executable on its own, just a project folder.
Jitteh Dawn --- A VN by Ivlivs

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#8 Post by IrinaLazareva »

I think I get it. The problem is not the function, but the file format. It seems like renpy 7.3.2 no longer supports playback of wav (including uncompressed PCM) files.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: renpy.sound.play() doesn't work on 7.3.2

#9 Post by Imperf3kt »

IrinaLazareva wrote: Fri Aug 09, 2019 7:28 am I think I get it. The problem is not the function, but the file format. It seems like renpy 7.3.2 no longer supports playback of wav (including uncompressed PCM) files.
I'm using wav files just fine in 7.3.2.320
On second testing, wav works in the last version of Ren'Py, but not 7.3.2.320, nice catch.

The only thing in the changelog that I can see might be related is:
Ren'Py now always initializes the media playback system, so that a movie can be played even if no audio will be played.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: No registered users