Page 1 of 1

Voice not playing, but 'Play Voice' works

Posted: Sun Feb 07, 2016 9:54 pm
by justcolorado
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?

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

Posted: Mon Feb 08, 2016 12:22 am
by namastaii
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")

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

Posted: Tue Feb 09, 2016 1:03 pm
by justcolorado
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.

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

Posted: Tue Feb 09, 2016 2:18 pm
by justcolorado
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.

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

Posted: Tue Feb 09, 2016 6:05 pm
by BlackDragonHunt
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.

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

Posted: Tue Feb 09, 2016 9:13 pm
by justcolorado
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