Music

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
SilverPhoenix34
Newbie
Posts: 5
Joined: Tue Nov 19, 2019 10:31 pm
Contact:

Music

#1 Post by SilverPhoenix34 »

Hi everyone, I'm having trouble getting music to stop. In my script I've had music begin just fine, but when I give the order for it to stop, this comes up

File "game/script.rpy", line 247: expected end of line
stop music"dedsecmusic.oog"
^

Ren'Py Version: Ren'Py 7.3.5.606
Tue Nov 19 21:33:37 2019

Any advice?

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

Re: Music

#2 Post by Imperf3kt »

You don't need the file name, audio in renpy works via channels.
Also, is your file .oog or .ogg
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

SilverPhoenix34
Newbie
Posts: 5
Joined: Tue Nov 19, 2019 10:31 pm
Contact:

Re: Music

#3 Post by SilverPhoenix34 »

Imperf3kt wrote: Tue Nov 19, 2019 10:47 pm You don't need the file name, audio in renpy works via channels.
Also, is your file .oog or .ogg
Thank you!

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

Re: Music

#4 Post by Imperf3kt »

Just to clarify, one channel can only play one audio file at a time (except the special "audio" channel)

The documentation can explain it better than I can.
https://www.renpy.org/doc/html/audio.html

https://www.renpy.org/doc/html/quicksta ... -and-sound
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

SilverPhoenix34
Newbie
Posts: 5
Joined: Tue Nov 19, 2019 10:31 pm
Contact:

Re: Music

#5 Post by SilverPhoenix34 »

Imperf3kt wrote: Wed Nov 20, 2019 10:21 pm Just to clarify, one channel can only play one audio file at a time (except the special "audio" channel)

The documentation can explain it better than I can.
https://www.renpy.org/doc/html/audio.html

https://www.renpy.org/doc/html/quicksta ... -and-sound
Sorry to bother you again, I'm getting this now.

I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 258, in script
"Raptor" "Well, here we are."
File "renpy/common/00library.rpy", line 268, in say
who(what, interact=interact, *args, **kwargs)
IOError: Couldn't find file 'newmarket.ogg'.

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

Re: Music

#6 Post by Imperf3kt »

Where did you place your file? You'll need to give renpy the full file path (relevant to the game folder)

So for example if you placed your music in a folder, you need to add the folder name to the path.
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

SilverPhoenix34
Newbie
Posts: 5
Joined: Tue Nov 19, 2019 10:31 pm
Contact:

Re: Music

#7 Post by SilverPhoenix34 »

Okay, so what do I type in for that?

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

Re: Music

#8 Post by Imperf3kt »

Well, if you placed it in a folder named "sound" then you simply add "sound/" to the start of the filename when playing the file. A full line would look like the following:

Code: Select all

    play music "sound/whatever.ogg"
But thats only if that is what your issue is. Without seeing more of your code, I can't really be sure. The traceback alludes to not being able to find the file, but thats all it tells you.


However, looking at your code again, it looks like you have two sets of "" in one line,

Code: Select all

    "Raptor" "Well, here we are."
    
I assume "Raptor" is a character name? You don't require the " around it and infact having that will cause issues.

Code: Select all

    Raptor "Well, here we are."
    
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: Ahrefs [Bot]