i cannot get speech to work.

Started by idkman, Sat 14/10/2017 21:04:08

Previous topic - Next topic

idkman

so the title says it, i cant get the speech to work.
according to the help file i did everything by the book.
(1) get the wav file,2)put it in the speech file in the game directory and name it 4 letters and a number,3)use & and the number in the script to activate it with the text.)
tried using cDude.saybackground ("&1 what ever"); didnt work.
i tried to roll back to AGS 3.3.5  didnt work, hell, i even tried it on another pc still didnt work.
nothing has worked so far.
music and sounds work but speech does not.
if anyone can help i would really apreciate it, this means alot to me.

Crimson Wizard

#1
Quote from: idkman on Sat 14/10/2017 21:04:08
tried using cDude.saybackground ("&1 what ever"); didnt work.
Speech does not work with SayBackground, only with Say. AGS does not have built-in support for background (non-blocking) voice-over.
Have you tried it with just Say command?

idkman

Yes, I have tried with out and it didn't work.

Crimson Wizard

#3
Other things to check:
1. You said that
Quote1) get the wav file, 2)put it in the speech file in the game directory
Just to be sure, by "it in the speech file" did you mean you put it in the "Speech" folder, or something different?
2. Are you launching the game from the Editor or directly from folder with game exe? If from folder, then is "speech.vox" actually present there?
3. May happen by mistake, if you are working with Windows Explorer and file extensions are hidden, sometimes you may type in a filename with extension (like ABCD1.WAV) but it will be set as a file name (creating a file named ABCD1.WAV.WAV).
4. There are particular types of WAVs that AGS refuses to play. Try playing same WAV as a usual sound clip in your game. Also, try using any random OGG or MP3 as a speech file.
5. Make sure "use digital speech" is enabled in winsetup. It should be by default, but better double check (you could turn it off by mistake).
6. Are you changing Speech.VoiceMode or SetVoiceMode anywhere in your script?

idkman

Yes, i did put the speech files in the speech folder.
I launch the game through the editor and yes the speechvox is present.
the file extention is not hidden.
I also tried ogg and mp3 and other types of files, still didnt work.
For some reason i cannot find "use digital speech" in winsetup.
and finally i did not change speech.voicemode, how ever i cannot find setvoicemode on the global script.



Slasher

Quoteand finally i did not change speech.voicemode, how ever i cannot find setvoicemode on the global script.
in Global.asc look for these lines:

Code: ags

function btnVoice_OnClick(GUIControl *control, MouseButton button)
{
  // Note that we don't check for the existence of speech.vox - we did that in game_start,
  // so if it's not there the button won't even be available.
  if (btnVoice.Text == "Voice and Text") { 
    Speech.VoiceMode = eSpeechVoiceOnly;
    btnVoice.Text = "Voice only";
  }
  else if (btnVoice.Text == "Voice only") {
    Speech.VoiceMode = eSpeechTextOnly;
    btnVoice.Text = "Text only";
  }
  else if (btnVoice.Text == "Text only") {
    Speech.VoiceMode = eSpeechVoiceAndText;
    btnVoice.Text = "Voice and Text";
  }
}


The button btnVoice is in the control panel. In-game it should NOT be set to Text only...



Crimson Wizard

Quote from: idkman on Sun 15/10/2017 13:19:37
For some reason i cannot find "use digital speech" in winsetup.

Sorry, it is called "Use voice pack if available", and located on "Advanced" tab.

TBH I am quite baffled by this, there may be something really small that we are missing.

Just to double check: your file is called "DUDE1.WAV" (or *.OGG/*.MP3), it is in the "<Your game project>/Speech" folder, and when you do "cDude.Say("&1 what ever");" in script - "what ever" is displayed on screen but you do not hear any voice?

idkman

yes,use voice pack if available was checked.
I have double checked , the file is called DUDE1.wav
also yes the text is displayed, not sound though.
(i also checked in game and it is set to text and voice.)

Crimson Wizard

I am completely out of ideas to be honest. Is it acceptable for you to upload your game project somewhere for us to check it out?

Slasher

make a new voice and save as DUDE2

and change &1 to &2 and try that..

Have you tried .ogg format?

Crimson Wizard

#10
Just for a test, I made a test game in AGS 3.4.0, put random audio file into Speech folder, renamed it to DUDE1, called cDude.Say("&1 blabla") in script, and that worked. I mean, that should be as easy as that to do, and if it does not work, something strange is going on...


Quote from: Slasher on Sun 15/10/2017 19:18:04
Have you tried .ogg format?

idkman said that he tried various formats:
Quote from: idkman on Sun 15/10/2017 13:19:37
I also tried ogg and mp3 and other types of files, still didnt work.

idkman

tried making a DUDE2.wav
still didnt work.
i also forgot to mention that i tried using speech in another game and on another computer and both didnt work.
(btw i used audacity for the wav and mp3 files).
im guessing because its not the files fault and not the computers fault, maybe its something simple im missing? at this point i have no idea what to even try.

Crimson Wizard

#12
Do you insert speech into a game just newly made of some template, or a bigger project you were working for a long time?
Could you upload one of your game projects with speech somewhere so that we could look into it? If that's ok with you.


m0ds

#13
If it's a new project what is the scripto name of your character. Worth double checking. You're calling your files DUDE but what if it's actually lines of EGO ? or if it's player.Say, it might also be EGO for the WAV file names. Also gotta be careful with scripto naming cos if you have characters BILLY1 and BILLY2, both are going to look for files called "BILL1.wav" and BILL2.wav etc which is a problem. Also, did you number the voice lines manually?

idkman

The charecter script name is _samhyde
and the speech file is called SAMM1.wav.
i tried to change the script name to SAM or SAMM, didnt work.
i gave the file a number when i exported from audacity.

Crimson Wizard

#15
Quote from: idkman on Mon 16/10/2017 11:37:13
The charecter script name is _samhyde
and the speech file is called SAMM1.wav.
i tried to change the script name to SAM or SAMM, didnt work.

If the script name is "_samhyde" then the wav's name should be "_SAM1.WAV".

The manual sais:
QuoteThe file name has format XXXXY.EXT, where XXXX is made of up to first four letters of the character's script name (except the leading 'c')
Since "_samhyde" does not have any leading 'c', then its just the very first 4 letters, which is "_sam".
Thinking about it, maybe "letters" may cause confusion here, since strictly speaking "_" is not a letter. So it should really read "first four symbols".

Not sure why it did not work if you change script name to SAMM though. (Maybe you changed "Real name" property instead by mistake?)

idkman

ALRIGHT! i renamed it to _SAM1.wav and it worked!!
im so happy finally its fixed, HUGE thanks man!!

Crimson Wizard

Quote from: idkman on Mon 16/10/2017 17:04:42
ALRIGHT! i renamed it to _SAM1.wav and it worked!!
im so happy finally its fixed, HUGE thanks man!!

Lol, you are welcome, but please tell precise names you were using next time! :)

SMF spam blocked by CleanTalk