renpy music won't play!! [SOLVED]
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.
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.
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
renpy music won't play!! [SOLVED]
I've put the music in the correct file, and have done the correct way to play music "audio/musicfile.mp3", to the point where Renpy used to recognise it and it worked just fine! Now, for some reason, it's having problems and saying it can't find my music file.
"OS error: Couldn't find the file 'audio/bgm_bachelorlearns.mp3'
Any idea if this is glitch or something off with my code?
these are the strings of code renpy has a problem with: play music "audio/bgm_bachelorlearns.mp3"
play music "audio/spookyviolin.mp3"
play music "audio/whitenoise.mp3" fadein 1.0
audio for other ones works as well following the exact same code. one that works is : play sound "audio/breathing.mp3"
aaa dont know what to do. bit confused
FOR FUTURE REFERENCE JUST IN CASE:
Check if songs are corrupted and can be playable in other music players
"OS error: Couldn't find the file 'audio/bgm_bachelorlearns.mp3'
Any idea if this is glitch or something off with my code?
these are the strings of code renpy has a problem with: play music "audio/bgm_bachelorlearns.mp3"
play music "audio/spookyviolin.mp3"
play music "audio/whitenoise.mp3" fadein 1.0
audio for other ones works as well following the exact same code. one that works is : play sound "audio/breathing.mp3"
aaa dont know what to do. bit confused
FOR FUTURE REFERENCE JUST IN CASE:
Check if songs are corrupted and can be playable in other music players
Last edited by roachflower on Tue Mar 14, 2023 6:00 am, edited 1 time in total.
- m_from_space
- Eileen-Class Veteran
- Posts: 1023
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: renpy music won't play!!
Renpy automatically detects all audio files inside the "audio" folder and stores them inside the audio-object. So when playing files you can simply do:
I'm not sure why some files play and others create an error though. You sure there is no typo inside the filename?
Code: Select all
play music spookyviolin
# or
play sound whitenoise
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
Re: renpy music won't play!!
Hi! First of all, thanks so much for replying. Unfortunately, this did not work.
I tried changing the file name to see if it would work, to something simple, so I renamed it, 'intro.mp3'.
I tried
play music intro.mp3
play music audio/intro.mp3
play music intro
and all the same variations with quotations marks, so play music "intro" and so on.
All of them show the same message, (OSerror: couldn't find file) except for one attempt, that wrote "Nameerror: name 'intro' not defined" which I think has to do with lack of quotation marks, but i don't know.
Sorry for being a timesucker, but I'm genuinely stumped. I don't know if this is a computer problem, or if I need to like reinstall renpy or something, but I am just so confused!!
I tried changing the file name to see if it would work, to something simple, so I renamed it, 'intro.mp3'.
I tried
play music intro.mp3
play music audio/intro.mp3
play music intro
and all the same variations with quotations marks, so play music "intro" and so on.
All of them show the same message, (OSerror: couldn't find file) except for one attempt, that wrote "Nameerror: name 'intro' not defined" which I think has to do with lack of quotation marks, but i don't know.
Sorry for being a timesucker, but I'm genuinely stumped. I don't know if this is a computer problem, or if I need to like reinstall renpy or something, but I am just so confused!!
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
Re: renpy music won't play!!
I even tried replacing said file, but now no sound works. life is pain
- m_from_space
- Eileen-Class Veteran
- Posts: 1023
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: renpy music won't play!!
This sounds odd.
Make sure:
1) the files are actually inside the "myproject/game/audio" folder (sorry for even mentioning that again!)
2) you have read access for those files (like they are not only accessible by root or admin or something)
Could you provide one of those files here? I could check if my project detects them. xD
Make sure:
1) the files are actually inside the "myproject/game/audio" folder (sorry for even mentioning that again!)
2) you have read access for those files (like they are not only accessible by root or admin or something)
Could you provide one of those files here? I could check if my project detects them. xD
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: renpy music won't play!!
try converting the mp3 files to ogg
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
Re: renpy music won't play!!
Okay, so since I messaged I found out why that 'intro.mp3' wasn't specifically playing (something to do with icloud) but there's still music that doesn't play for no reason.
How do I check read access?! And sure, I can send a rain mp3, but I don't know how to do that, haha.
How do I check read access?! And sure, I can send a rain mp3, but I don't know how to do that, haha.
- m_from_space
- Eileen-Class Veteran
- Posts: 1023
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: renpy music won't play!!
When replying here, you can add an attachment below the buttons next to "Options".roachflower wrote: ↑Sun Mar 12, 2023 2:43 pm Okay, so since I messaged I found out why that 'intro.mp3' wasn't specifically playing (something to do with icloud) but there's still music that doesn't play for no reason.
How do I check read access?! And sure, I can send a rain mp3, but I don't know how to do that, haha.
Normally files should have read access, I just added this to be sure. If other programs can play them, you should be save.
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
Re: renpy music won't play!!
Okay, it's not letting me attach anything, but holy shit.
I tried playing all of the problematic sound files and to my HORROR they all do not play. No idea why not, but they just cannot be played by usual players. Looks like I'll have to replace a lot of sounds I thought were fine.
Thank you so much for continuing to reply (and for helping me figure out how to use these forums, lol.)
The last question I have for you because you seem very Knowledgeable is that my game cannot recognise my "main_menu.png" in the gui, so I can't access my load screens in game. Any reason behind this?
I tried playing all of the problematic sound files and to my HORROR they all do not play. No idea why not, but they just cannot be played by usual players. Looks like I'll have to replace a lot of sounds I thought were fine.
Thank you so much for continuing to reply (and for helping me figure out how to use these forums, lol.)
The last question I have for you because you seem very Knowledgeable is that my game cannot recognise my "main_menu.png" in the gui, so I can't access my load screens in game. Any reason behind this?
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: renpy music won't play!!
what properly happened is that your music files got corrupted somehow due to power outages or bad hard drive or bad sector on the driveroachflower wrote: ↑Mon Mar 13, 2023 5:08 am Okay, it's not letting me attach anything, but holy shit.
I tried playing all of the problematic sound files and to my HORROR they all do not play. No idea why not, but they just cannot be played by usual players. Looks like I'll have to replace a lot of sounds I thought were fine.
Thank you so much for continuing to reply (and for helping me figure out how to use these forums, lol.)
have you changed anything in screens.rpy if so can you provide your changesroachflower wrote: ↑Mon Mar 13, 2023 5:08 am The last question I have for you because you seem very Knowledgeable is that my game cannot recognise my "main_menu.png" in the gui, so I can't access my load screens in game. Any reason behind this?
this is what the code should look like
Code: Select all
style main_menu_frame:
xsize 420
yfill True
background "gui/overlay/main_menu.png"
or
it could be the reason what I said about your hard drive or file is corrupted
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3808
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: renpy music won't play!!
Do you hide file extensions, or are they shown?
I've seen people often accidentally name files things like "mysong.mp3.mp3"
I've seen people often accidentally name files things like "mysong.mp3.mp3"
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
Re: renpy music won't play!!
THANK YOU SO MUCH OH MY GOD?!?rayminator wrote: ↑Mon Mar 13, 2023 9:44 am have you changed anything in screens.rpy if so can you provide your changes
this is what the code should look like
can you go to gui/overlay and find main_menu.png and open it in any photo edit to see if it opens up?Code: Select all
style main_menu_frame: xsize 420 yfill True background "gui/overlay/main_menu.png"
or
it could be the reason what I said about your hard drive or file is corrupted
I had never opened screens.rpy, so the default was
# background "gui/main_menu.png/"
Which I thought was weird, so i then deleted the hashtag and replaced it with your code. THEN I got an error message that the game_menu couldn't be found. I put the dots together and found out that for some bizarre reason the code was changed to just "/game_menu.png" which meant it couldn't find it.
No idea why it turned out like that, I hadn't ever opened screens.rpy. Thank you so much! I'm a newbie programmer so I'm still learning why the program does what it does.
Thanks for everyone's time and help, my problems are now SOLVED to completion!!!
-
- Newbie
- Posts: 7
- Joined: Sat Mar 11, 2023 6:51 am
- Contact:
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]