Voice not playing, but 'Play Voice' works

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
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

Voice not playing, but 'Play Voice' works

#1 Post by justcolorado » Sun Feb 07, 2016 9:54 pm

I want to make my first Visual Novel.
I have been going through the tutorials and playing around with RenPy.
It is a really great program.

For some reason, when I execute this below nothing plays.

Code: Select all

voice "angela.ogg"
angela "say something" 
voice sustain
If I switch it 'voice' to 'play voice' it plays fine, (so there is nothing wrong with my file or path)
but I want it to run with voice, so I can use (or not use) sustain.

Does anyone know what could be causing this?

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Voice not playing, but 'Play Voice' works

#2 Post by namastaii » Mon Feb 08, 2016 12:22 am

Hmm...have you done all the steps listed in here? Such as attaching the voices to the characters and stuff like that?

http://www.renpy.org/doc/html/voice.html

like this?

Code: Select all

define e = Character("Eileen", voice_tag="eileen")

User avatar
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

Re: Voice not playing, but 'Play Voice' works

#3 Post by justcolorado » Tue Feb 09, 2016 1:03 pm

Thank you for your reply!

I think I followed everything on the page you sent and it still didn't work.
here is what I did:

Code: Select all


label voicetest:
    
    define s = Character('Sylvie', color="#c8ffc8", voice_tag="s"
    
    s "Voice testing"
    $ PlayCharacterVoice(s,"angela.ogg")
    s "Can you hear me now?  I am testing the voice functionality"
    s "more text"
    
    return
And I tried that with and without the Mute Toggling that was in the example.
Nothing would play.

Voicetags seem very useful for organizing things.
From the instructions I read I understood they are Optional.
I did some tests without tags that I show in my next post
The test results suggest that tags are not needed at all.

I did find something interesting though:

If I execute this:

Code: Select all


label voicetest:
    
    "Voice testing"
    voice "filethatdoesntexist.ogg"
    "Can you hear me now?  I am testing the voice functionality"

    return

It of course does not play, but it also does not crash or return errors telling me that it could not find the file

if I execute this

Code: Select all

label voicetest:
    
    "Voice testing"
    play voice "filethatdoesntexist.ogg"
    "Can you hear me now?  I am testing the voice functionality"

    return

It crashes and returns the error that it can't find it
If I switch it to a real filename the second one plays the first one does not.
Further, if I put a fake filename with the direct Python function call

Code: Select all

    $ PlayCharacterVoice(s,"filethatdoesnotexist.ogg")
it still doesn't crash
I hope this provides some insight as to what I am doing wrong.

and would really appreciate any help to fix this.
Last edited by justcolorado on Tue Feb 09, 2016 2:25 pm, edited 3 times in total.

User avatar
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

Re: Voice not playing, but 'Play Voice' works

#4 Post by justcolorado » Tue Feb 09, 2016 2:18 pm

OK I found something even more strange so I am adding this as a separate post.
I may have isolated the problem. But not the solution.

I can get voice to work as it is supposed to.
If I place the angela.ogg in the game directory, and execute this line inside of the project "The Question"
But it only works inside of that project?????

Code: Select all

    voice "angela.ogg"
voice works perfectly and as expected.
she keeps talking until I go to the next line.
if I use voice sustain that works perfectly as well.

So it is definitely not my file or the way I am calling voice.

and if I do this inside of The_Question project

Code: Select all

    voice "filethatdoesnotexist.ogg"
it crashes and tells me that it cannot find the file, as it should.

This probably also answers the question about the need for setting up character tags.
Looks like none of that stuff is necessary.

If I do the same thing in a new project it does not play at all.
no matter what I do.

So I can make it work if I don't set up a new project and only edit the question.
But I want to be able to create a new projects and have my voice files there.

Can someone else please test this.
If anyone has any insight to this, please share it with me.

User avatar
BlackDragonHunt
Newbie
Posts: 8
Joined: Fri Oct 09, 2015 6:33 am
Organization: MangaGamer
Contact:

Re: Voice not playing, but 'Play Voice' works

#5 Post by BlackDragonHunt » Tue Feb 09, 2016 6:05 pm

Have you set config.has_voice to True in your options.rpy file?

config.has_voice defaults to False in a new project, which would explain why the "voice" statement doesn't give you any errors--if it's set to False, the statement doesn't do anything. It doesn't even look at the filename you gave it. Meanwhile, "play voice" sidesteps the voice system entirely, playing the file like any other audio, just using the "voice" channel. Finally, PlayCharacterVoice is a screen action (intended for playing voice samples on an options menu, where you can separately configure the volume for individual characters), so it doesn't execute when you call it like that in a regular script.

User avatar
justcolorado
Regular
Posts: 47
Joined: Sun Feb 07, 2016 9:32 pm
Completed: Experiment Gone Rogue, Caravan Of Saints, HeartBaked, Hipster Axe
Projects: Iragon
Organization: Repulse.com
Github: coloradostark
Location: Plovdiv
Contact:

Re: Voice not playing, but 'Play Voice' works

#6 Post by justcolorado » Tue Feb 09, 2016 9:13 pm

BlackDragonHunt wrote:Have you set config.has_voice to True in your options.rpy file?

config.has_voice defaults to False in a new project, which would explain why the "voice" statement doesn't give you any errors--if it's set to False, the statement doesn't do anything. It doesn't even look at the filename you gave it. Meanwhile, "play voice" sidesteps the voice system entirely, playing the file like any other audio, just using the "voice" channel. Finally, PlayCharacterVoice is a screen action (intended for playing voice samples on an options menu, where you can separately configure the volume for individual characters), so it doesn't execute when you call it like that in a regular script.

Thank you!!!!!!!!

That was exactly the problem.
I changed it to True and everything works now.

Thank you

Post Reply

Who is online

Users browsing this forum: Bing [Bot]