Hey, everyone,
I've looked everywhere online, but I haven't seen anyone with this specific issue. What's odd is that in the beginning of the game, the music plays just fine, but around line 700, it won't play. The music is copied to the game and audio folder, which had worked for all of the songs. Does the traceback hint at where the problem is? I'm not familiar enough with Ren'Py to know exactly what's going wrong. (Would it help for me to include code? I didn't want to spam with my entire VN, but the problem is so bizarre that I'm not sure what would help.)
Thank you very much!
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 721, in script
play music tokyo.ogg
File "renpy/common/000statements.rpy", line 120, in execute_play_music
renpy.music.play(_audio_eval(p["file"]),
File "renpy/common/000statements.rpy", line 32, in _audio_eval
return eval(expr, locals=store.audio.__dict__)
File "game/script.rpy", line 721, in <module>
play music tokyo.ogg
AttributeError: 'unicode' object has no attribute 'ogg'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 721, in script
play music tokyo.ogg
File "C:\Users\14076\Downloads\renpy-7.3.5-sdk\renpy\ast.py", line 1949, in execute
self.call("execute")
File "C:\Users\14076\Downloads\renpy-7.3.5-sdk\renpy\ast.py", line 1937, in call
return renpy.statements.call(method, parsed, *args, **kwargs)
File "C:\Users\14076\Downloads\renpy-7.3.5-sdk\renpy\statements.py", line 277, in call
return method(parsed, *args, **kwargs)
File "renpy/common/000statements.rpy", line 120, in execute_play_music
renpy.music.play(_audio_eval(p["file"]),
File "renpy/common/000statements.rpy", line 32, in _audio_eval
return eval(expr, locals=store.audio.__dict__)
File "C:\Users\14076\Downloads\renpy-7.3.5-sdk\renpy\python.py", line 2059, in py_eval
return py_eval_bytecode(code, globals, locals)
File "C:\Users\14076\Downloads\renpy-7.3.5-sdk\renpy\python.py", line 2052, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/script.rpy", line 721, in <module>
play music tokyo.ogg
AttributeError: 'unicode' object has no attribute 'ogg'
Windows-8-6.2.9200
Ren'Py 7.3.5.606
The Legend of Jessie Cube 1.0
Wed Jan 20 15:58:58 2021
You forgot to wrap your file name in quotation.
Add " to the start and end of the filename.
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
Imperf3kt wrote: ↑Wed Jan 20, 2021 5:21 pm
You forgot to wrap your file name in quotation.
Add " to the start and end of the filename.
play music "tokyo.ogg"
How embarrassing. Thank you so much! You really helped me out.
Adding on to Imperf3kt's answer:
When a sound file is in the game/audio/ directory, and doesn't contain spaces or other special characters, it winds up getting defined in the audio namespace. The play and queue statements try the audio namespace before the default one. So you can just write: