{SOLVED!} Why won't sound or music play at all?!

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
User avatar
Ibitz
Regular
Posts: 63
Joined: Thu Jul 27, 2017 4:47 pm
Projects: Magical Disarray (WIP)
Organization: Ibitz Visual Novels
Deviantart: http://ibitz.deviant
itch: ibitz
Contact:

{SOLVED!} Why won't sound or music play at all?!

#1 Post by Ibitz »

I've been working on my demo art, trying to perfect it before continuing to code my game. I come back to find Ren'Py has basically been "updated", completely ruining my sounds and music in game. Nothing I do can seem to get it to be recognized. It won't run in any of the menus or in the game itself.

I've tried all of these types of things throughout my code:

THESE ARE IN THE SCRIPT:

define config.debug_sound = True

$ renpy.music.set_volume(volume=0.0, channel='two')
$ renpy.music.set_volume(volume=0.1, channel='one')
$ renpy.music.set_volume(volume=0.1, channel='three')
$ renpy.music.set_volume(volume=0.3, channel='seven')

init python:
config.default_music_volume = 0.45
config.debug_sound = True
config.say_attribute_transition
config.debug
config.default_transform
config.exit_sound = None
renpy.music.register_channel ("music", mixer = "music", loop = True, stop_on_mute = True, tight = False, file_prefix = 'audio/music/', file_suffix = '.ogg', buffer_queue = True)
renpy.music.register_channel ("sound", mixer = "sfx", loop = False, stop_on_mute = True, tight = False, file_prefix = 'audio/music/', file_suffix = '.ogg', buffer_queue = True)

##THESE ARE IN THE OPTIONS ############################################################

## These three variables control which mixers are shown to the player by
## default. Setting one of these to False will hide the appropriate mixer.

define config.has_sound = True
define config.has_music = True
define config.has_voice = False
define config.debug_sound = True

## To allow the user to play a test sound on the sound or voice channel,
## uncomment a line below and use it to set a sample sound to play.

# define config.sample_sound = "Bell"


## Uncomment the following line to set an audio file that will be played while
## the player is at the main menu. This file will continue playing into the
## game, until it is stopped or another file is played.

# define config.main_menu_music = "Dreamy-Game-Menu_Looping"

I have tried keeping them in their separate folders (SFX/MUSIC) and then putting them in the main game folder and I have also tried adding and removing their locations from the names of the music/sounds along with the .ogg. But literally nothing is working.

I have restarted my whole script and options from scratch, remaking a completely new RPY file and project AND STILL NOTHING!!!!

This is getting really ridiculous and frustrating. It already took me all day just to re-animate my main menu because of all the dumb ATL changes. I really hope this gets fixed or I might just give up on Ren'Py and go learn Unity or something else.
Last edited by Ibitz on Wed Dec 18, 2019 8:33 pm, edited 1 time in total.
Image

Ibitz is a self-taught coder/artist who works alone on their games. All games I create are freeware. If you need any help with coding or creating your game, just let me know. I'd be more than happy to help.

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Why won't sound or music play at all?!

#2 Post by isobellesophia »

It must be the debug, try this.
https://www.renpy.org/doc/html/config.h ... ebug_sound

Code: Select all

define config.debug_sound = False
Note on the documentation stated above.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
Ibitz
Regular
Posts: 63
Joined: Thu Jul 27, 2017 4:47 pm
Projects: Magical Disarray (WIP)
Organization: Ibitz Visual Novels
Deviantart: http://ibitz.deviant
itch: ibitz
Contact:

Re: Why won't sound or music play at all?!

#3 Post by Ibitz »

Sadly no sound, still. I'm gonna keep messing with it and going through Lemma forums. Hopefully someone has a solution that will randomly work.
Image

Ibitz is a self-taught coder/artist who works alone on their games. All games I create are freeware. If you need any help with coding or creating your game, just let me know. I'd be more than happy to help.

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

Re: Why won't sound or music play at all?!

#4 Post by Imperf3kt »

Your sound sample is commented out, is this the sound you are trying to play? You need to remove the # (and the blank space) from the line define config.sample_sound = "Bell"

It also needs to be a file name (Bell.wav) or renpy won't find the file as it gets used at init, but "Bell" isn't defined until after init
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

User avatar
Ibitz
Regular
Posts: 63
Joined: Thu Jul 27, 2017 4:47 pm
Projects: Magical Disarray (WIP)
Organization: Ibitz Visual Novels
Deviantart: http://ibitz.deviant
itch: ibitz
Contact:

Re: Why won't sound or music play at all?!

#5 Post by Ibitz »

Thank you so much, Imperf3kt! I cannot believe that I didn't even notice the #. Once that was gone, the music started up. I think I blame my new job for my brain fog. Once again, thank you! I wish I could give you a gold star or something as a prize for being awesome and helping me.

And, thank you, isobellesophia, as well, for you help! :)
Image

Ibitz is a self-taught coder/artist who works alone on their games. All games I create are freeware. If you need any help with coding or creating your game, just let me know. I'd be more than happy to help.

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

Re: Why won't sound or music play at all?!

#6 Post by Imperf3kt »

All good, just glad to help.
I quite often stumble on the simple stuff myself, always making basic mistakes that I should already know lol. For example, just a couple of days ago I spent an hour trying to figure out why I was getting a syntax error in line 119, with reference to line 126, when the issue all along was simply that I had placed one = instead of two in line 126. I was looking at line 119 only, and didn't even see the most obvious of issues.

Great to see it's working now.
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

User avatar
Ibitz
Regular
Posts: 63
Joined: Thu Jul 27, 2017 4:47 pm
Projects: Magical Disarray (WIP)
Organization: Ibitz Visual Novels
Deviantart: http://ibitz.deviant
itch: ibitz
Contact:

Re: {SOLVED!} Why won't sound or music play at all?!

#7 Post by Ibitz »

Definitely! Coding is crazy when you do it by yourself. That's why it's best when people help each other out. I hate the simple errors like that, too.
Thanks, again! :) Now I just have to figure out my dialogue/textbox and everything will finally be figured out. These new updates kinda made things confusing. I'm glad you figured out your issue, too!
Image

Ibitz is a self-taught coder/artist who works alone on their games. All games I create are freeware. If you need any help with coding or creating your game, just let me know. I'd be more than happy to help.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]