[Solved] Audio can't be found

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
TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

[Solved] Audio can't be found

#1 Post by TRIDENT_12 » Wed Dec 22, 2021 10:06 pm

So I'm trying to play audio over the credits sequence...
But ren'py says it can't find the file, despite being defined correctly
Here's the traceback

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/credits.rpy", line 9, in script
    with dissolve
IOError: Couldn't find file 'music/credits.ogg'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/credits.rpy", line 9, in script
    with dissolve
  File "renpy/ast.py", line 1443, in execute
    renpy.exports.with_statement(trans, paired)
  File "renpy/exports.py", line 1682, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "renpy/display/core.py", line 2752, in do_with
    clear=clear)
  File "renpy/display/core.py", line 3315, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 4020, in interact_core
    renpy.audio.audio.periodic()
  File "renpy/audio/audio.py", line 1162, in periodic
    raise_(exc[0], exc[1], exc[2])
  File "renpy/audio/audio.py", line 1140, in periodic_thread_main
    periodic_pass()
  File "renpy/audio/audio.py", line 1082, in periodic_pass
    c.periodic()
  File "renpy/audio/audio.py", line 518, in periodic
    topf = load(filename)
  File "renpy/audio/audio.py", line 69, in load
    rv = renpy.loader.load(fn)
  File "renpy/loader.py", line 798, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file 'music/credits.ogg'.

Windows-10-10.0.22000
Ren'Py 7.4.10.2178
LibitinaV2 1.0
Thu Dec 23 12:01:16 2021
In "definitions.rpy" I have:

Code: Select all

define audio.cmusic = ("music/credits1.wav")
And in "credits.rpy", I have

Code: Select all

label credits:
    $ credits_speed = 25 #scrolling speed in seconds
    scene black #replace this with a fancy background
    with dissolve
    play music cmusic
    show theend:
        yanchor 0.5 ypos 0.5
        xanchor 0.5 xpos 0.5
    with dissolve
    with Pause(3)
    hide theend
    show cred at Move((0.5, 5.0), (0.5, 0.0), credits_speed, repeat=False, bounce=False, xanchor="center", yanchor="bottom")
    with Pause(credits_speed)
    show thanks:
        yanchor 0.5 ypos 0.5
        xanchor 0.5 xpos 0.5
    with dissolve
    with Pause(3)
    hide thanks
    return
What am I doing wrong?
And how do I fix it?
And yes, I've made sure the audio is in the right directory etc.
Last edited by TRIDENT_12 on Thu Dec 23, 2021 6:51 am, edited 1 time in total.

User avatar
enaielei
Regular
Posts: 114
Joined: Fri Sep 17, 2021 2:09 am
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Audio can't be found

#2 Post by enaielei » Thu Dec 23, 2021 12:37 am

Why is your definition different from what's appearing in the error? It says you're missing a .ogg file, while you have a music defined as .wav (different name too).

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

Re: Audio can't be found

#3 Post by TRIDENT_12 » Thu Dec 23, 2021 12:44 am

enaielei wrote:
Thu Dec 23, 2021 12:37 am
Why is your definition different from what's appearing in the error? It says you're missing a .ogg file, while you have a music defined as .wav (different name too).
Because I was an idiot and posted the wrong traceback

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/credits.rpy", line 9, in script
    with dissolve
IOError: Couldn't find file 'music/credits1.wav'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/credits.rpy", line 9, in script
    with dissolve
  File "renpy/ast.py", line 1443, in execute
    renpy.exports.with_statement(trans, paired)
  File "renpy/exports.py", line 1682, in with_statement
    return renpy.game.interface.do_with(trans, paired, clear=clear)
  File "renpy/display/core.py", line 2752, in do_with
    clear=clear)
  File "renpy/display/core.py", line 3315, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, **kwargs)
  File "renpy/display/core.py", line 4020, in interact_core
    renpy.audio.audio.periodic()
  File "renpy/audio/audio.py", line 1162, in periodic
    raise_(exc[0], exc[1], exc[2])
  File "renpy/audio/audio.py", line 1140, in periodic_thread_main
    periodic_pass()
  File "renpy/audio/audio.py", line 1082, in periodic_pass
    c.periodic()
  File "renpy/audio/audio.py", line 518, in periodic
    topf = load(filename)
  File "renpy/audio/audio.py", line 69, in load
    rv = renpy.loader.load(fn)
  File "renpy/loader.py", line 798, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file 'music/credits1.wav'.

Windows-10-10.0.22000
Ren'Py 7.4.10.2178
LibitinaV2 1.0
Thu Dec 23 14:43:32 2021

There we go!

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

Re: Audio can't be found

#4 Post by Imperf3kt » Thu Dec 23, 2021 3:18 am

Just to be sure, Ren'Py (or more specifically, Python) is case-sensitive.
Have you checked the file is not actually called "Credits1.wav" or the folder "Music"?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

Re: Audio can't be found

#5 Post by TRIDENT_12 » Thu Dec 23, 2021 3:21 am

Imperf3kt wrote:
Thu Dec 23, 2021 3:18 am
Just to be sure, Ren'Py (or more specifically, Python) is case-sensitive.
Have you checked the file is not actually called "Credits1.wav" or the folder "Music"?
I did check that
It's named correctly.

User avatar
enaielei
Regular
Posts: 114
Joined: Fri Sep 17, 2021 2:09 am
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Audio can't be found

#6 Post by enaielei » Thu Dec 23, 2021 5:45 am

Perhaps show us a screenshot of your current folder structure where that audio is placed?

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

Re: Audio can't be found

#7 Post by TRIDENT_12 » Thu Dec 23, 2021 5:53 am

enaielei wrote:
Thu Dec 23, 2021 5:45 am
Perhaps show us a screenshot of your current folder structure where that audio is placed?
Here
Attachments
Screenshot 2021-12-23 195207.png
And inside the music folder
Screenshot 2021-12-23 195207.png (4.77 KiB) Viewed 285 times
Screenshot 2021-12-23 194925.png
Audio folder
Screenshot 2021-12-23 194925.png (3.53 KiB) Viewed 285 times

User avatar
henne
Newbie
Posts: 11
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Audio can't be found

#8 Post by henne » Thu Dec 23, 2021 6:36 am

I think you have to add "audio", so "audio/music/credits1.wav".

TRIDENT_12
Regular
Posts: 30
Joined: Tue Aug 03, 2021 4:29 pm
Projects: The Monster Within
Github: TRIDENT1313
Discord: TRIDENT_12#2285
Contact:

Re: Audio can't be found

#9 Post by TRIDENT_12 » Thu Dec 23, 2021 6:50 am

henne wrote:
Thu Dec 23, 2021 6:36 am
I think you have to add "audio", so "audio/music/credits1.wav".
That was EXACTLY what I needed to do!
Thank you!
Now I feel really stupid for not realising!

User avatar
henne
Newbie
Posts: 11
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: [Solved] Audio can't be found

#10 Post by henne » Thu Dec 23, 2021 9:40 am

Happens to the best :)

Post Reply

Who is online

Users browsing this forum: Google [Bot]