ERROR - music loop error

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
TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

ERROR - music loop error

#1 Post by TigerAlpaca » Wed Jul 25, 2018 2:42 am

I'm new to all this coding lark, especially when it comes to coding in music. I always seem to get weird errors or the music is too loud. Like this error I just got.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 101, in script
    play music "<loop>beating hearts bgmusic.mp3"
  File "renpy/common/000statements.rpy", line 125, in execute_play_music
    if_changed=p.get("if_changed", False))
Exception: Parsing audio spec u'<loop>beating hearts bgmusic.mp3': expected float at end..

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

Full traceback:
  File "game/script.rpy", line 101, in script
    play music "<loop>beating hearts bgmusic.mp3"
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\ast.py", line 1828, in execute
    self.call("execute")
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\ast.py", line 1816, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\statements.py", line 177, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 125, in execute_play_music
    if_changed=p.get("if_changed", False))
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\audio\music.py", line 112, in play
    c.enqueue(filenames, loop=loop, synchro_start=synchro_start, fadein=fadein, tight=tight, loop_only=loop_only)
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\audio\audio.py", line 534, in enqueue
    filename, _, _ = self.split_filename(filename, False)
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\audio\audio.py", line 316, in split_filename
    loop = expect_float()
  File "C:\Users\ellie\Downloads\renpy-6.99.14.1-sdk\renpy\audio\audio.py", line 286, in expect_float
    raise exception("expected float at end.")
Exception: Parsing audio spec u'<loop>beating hearts bgmusic.mp3': expected float at end..

Windows-8-6.2.9200
Ren'Py 7.0.0.196
Beating Hearts 2.0
Wed Jul 25 07:38:48 2018
Can anybody help me? Here's the code if you're interested.

Code: Select all

# These display lines of dialogue.
    
    play music "<loop>beating hearts bgmusic.mp3"
    
    u "Okay, before we start, %(player_name)s- would you like an explanation of the world this is set in?"

User avatar
MaydohMaydoh
Regular
Posts: 165
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: ERROR - music loop error

#2 Post by MaydohMaydoh » Wed Jul 25, 2018 3:26 am

If you're just trying to have the song repeat until a new song is played, then you don't need to use loop. Renpy automatically does this
Loop specifies the position in the file at which the second and later play-throughs begin playing and should be given a float number telling renpy where to begin playing from.

https://www.renpy.org/doc/html/audio.ht ... l-playback

TigerAlpaca
Regular
Posts: 38
Joined: Tue Apr 03, 2018 4:19 am
Contact:

Re: ERROR - music loop error

#3 Post by TigerAlpaca » Sat Jul 28, 2018 10:21 am

MaydohMaydoh wrote:
Wed Jul 25, 2018 3:26 am
If you're just trying to have the song repeat until a new song is played, then you don't need to use loop. Renpy automatically does this
Loop specifies the position in the file at which the second and later play-throughs begin playing and should be given a float number telling renpy where to begin playing from.

https://www.renpy.org/doc/html/audio.ht ... l-playback
Oh, okay. The documentation wasn't very clear - but maybe that was just me reading it at 3 o'clock in the morning. Thanks for helping!

Post Reply

Who is online

Users browsing this forum: Google [Bot], Ocelot