Audio Speech File Not Playing - [SOLVED]

Started by Adeel, Sun 06/10/2013 19:11:28

Previous topic - Next topic

Adeel

Hello BTQ, long time no see! :)

Since the last time I visited here, I've learned much about AGS
Scripting and still continue to do so. I, however, don't have any prior
experience of Voice Scripting. Therefore, I decided to have a go. But
unfortunately, I've come across a problem and I don't know what to do
now.

My character name is cMom. I wanted to add voice speech for this
character. I read the manual and followed its instructions. I copied my
voice clip (.mp3 file) in the game's Speech Folder and named it MOM01
(faithfully similar to the manual entry).

Then I added the following code:

Code: ags
function cMom_Interact(){
    cMom.Say("&01 Why is your room so messy every time I walk in 
here?"); //lets name this whole line "A" for now.
}


But no sound/voice is played. I thought that maybe I accidentally turned
volume down either within game or externally. But when I checked,
neither was true. I added a sound effect and it was playing fine. Then I
thought that maybe something is wrong with this clip so I even copied a
song (.mp3 file) into my Speech folder and renamed it to MOM08. But
still, no voice is played when I call the following code:

Code: ags
function cMom_Interact(){
    cMom.Say("&08 Why is your room so messy every time I walk in 
here?");// lets name this whole line "B" for now. 
}


I checked my Compiled folder and speech.vox was present with the
exact size of my Speech folder. I tried rebuilding my files but to no
avail. After some more banging my head on my desk, I noticed a
warnings.log created in my game folder. It said:

(in room 6): Speech load failure:
'~speech.vox~Mom1.mp3'
  ---- when I were using A.

and

(in room 6): Speech load failure:
'~speech.vox~Mom8.mp3'
  ---- when I used B.

I wanted to know:

1. Why is the game failing to load speech?
2. Is .mp3 not properly supported by AGS?
3. What am I doing wrong?

I searched the forums before posting here. But I couldn't find something
similar of this nature.

Thanks in advance. :)

Crimson Wizard

#1
I think the answer is in your question:

Quote from: Adeel S. Ahmed on Sun 06/10/2013 19:11:28
My character name is cMom. I wanted to add voice speech for this character. I read the manual and followed its instructions. I copied my voice clip (.mp3 file) in the game's Speech Folder and named it MOM01 (faithfully similar to the manual entry).

(in room 6): Speech load failure: '~speech.vox~Mom1.mp3'  ---- when I were using A.

(in room 6): Speech load failure: '~speech.vox~Mom8.mp3'  ---- when I used B.

AFAIK there should not be any preceding 0's in filenames. Also, you do not have to put 0's in the speech lines as well:
Code: ags

cMom.Say("&01 ");
// this should have same result:
cMom.Say("&1 ");


E: Just a guess: maybe you misinterpreted example from manual:
Quoteego: &10 "Hi! How are you?"
david: &7 "I'm fine."

This would play EGO10.WAV with the first line, and DAVI7.WAV with the second

In EGO10.WAV - the third symbol is O (letter), not 0 (digit).

monkey0506

#2
Quote from: Crimson Wizard on Sun 06/10/2013 19:26:17In EGO10.WAV - it is O (letter), not 0 (digit).

No it isn't. That is the tenth speech line. (wtf) it is the integer 10, not a number 1 and a letter O.

Edit: Scratch that. Sorry, I was...um... I see what you meant. (lol)

Khris

#3
Monkey:
It's "EG", then the letter O, followed by a 10, which Adeel apparently read as 010.

I'm wondering though. You have used a file called MOM01.mp3, and AGS tells you it can't find MOM1.mp3. The manual entry also mentions DAVI7.mp3 ...
It's especially hilarious that you actually said you did this "faithfully similar" to the manual entry :-D

monkey0506

Heh, yeah I just realized what CW was saying. Yes, speech files are always named XXXXYYY.EXT where XXXX is the first four letters and/or numbers of the character's name (sans the leading 'c'). So for "cEgo" this is "EGO", for "cGuybrush" this is "GUYB" and for "cRob1" this would be "ROB1". The YYY is the speech file number with no leading or trailing zeroes or padding of any kind. EXT is just the file extension, such as WAV.

Crimson Wizard

lol.
Ok, I fixed my post to prevent misunderstanding. ;)

Adeel

First of all, thanks for the input, guys :). Especially, a big thanks to Crimson Wizard & monkey_05_06 (nod).

No, I didn't misinterpreted EGO10.WAV as 010 (laugh). There were two reasons which is why I used a 0 before 1:

1. Easier to read.
2. Looks cool ;)

Quote from: Khris on Mon 07/10/2013 03:20:34
[...] It's especially hilarious that you actually said you did this "faithfully similar" to the manual entry :-D
Well, when I wrote faithfully similar, I had capitalization in my mind. Never in my mind it occurred that it was just a zero causing all these problems. :P

Thanks once again, guys. Sorry for my very late reply. I were so busy that I didn't even check the Internet for two, full days 8-0!

Quote from: monkey_05_06 on Mon 07/10/2013 03:24:13
[...] Yes, speech files are always named XXXXYYY.EXT where XXXX is the first four letters and/or numbers of the character's name (sans the leading 'c'). So for "cEgo" this is "EGO", for "cGuybrush" this is "GUYB" and for "cRob1" this would be "ROB1". The YYY is the speech file number with no leading or trailing zeroes or padding of any kind. EXT is just the file extension, such as WAV.

This is such a nice explanation. Crimson, will you please add this in the manual's Speech section? Because it isn't mentioned in manual that speech files will not be played if there are any leading or trailing zeros.

Cheers! ;-D

Khris

The manual gives a total of three examples of the filename format, and you got a warning that told you exactly why it didn't work, yet you want the manual be changed because you stupidly did something because it looked cool?
Riiiiiiight.

Adeel

Quote from: Khris on Thu 10/10/2013 00:02:32
The manual gives a total of three examples of the filename format, and you got a warning that told you exactly why it didn't work, yet you want the manual be changed because you stupidly did something because it looked cool?
Riiiiiiight.

And was easier to read....

And its not for me (for I've learned), its for the others who may ever get stuck simply due to this problem. And never did I say to change the manual. I only requested to add the monkey's paragraph along with the already present text.

Khris

If adding something to the manual isn't changing it, how about we leave the manual in its exact current state then? (roll)

Adeel

Khris, I requested CW, not you. So I wouldn't have mind at all if he replied the same. But you, sir, didn't help me and went on to mock me. Please, don't act like you're compiling the manual and/or coding the engine or its your duty to insult everyone who make mistakes stupidly (a mistake without stupidity isn't a mistake at all). (wtf)

I confessed honestly. What was stopping me not to post that I tried to go this way because apart from being easier to read, it looks cool? But I confessed because I were mistaken and felt sorry for my stupidity! What are you going to do now? Throw me in prison for several years for that?

And I didn't said to alter/change the text (which, your previous post suggested, I were trying to do). I only said to add the paragraph.

Crimson Wizard

Formally speaking, manual does not provide a strict format description, it just sais "ID number". Can engine parse the number with leading zeroes correctly? Who knows (in some other cases it does, e.g. speech numbers in text). Less technically savvy person may not even consider this as a possible problem.

The manual currently states: "The file name is made up of the first four letters of the character's script name, then an ID number".
What's wrong in adding, for example, "...then an ID number with no leading or trailing zeroes or padding of any kind"?

PS. BTW, there was a topic on improving the manual:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=46471.0

Adeel

Thank you, Crimson Wizard. Sir, you made a valid point from a beginner's point of view. (nod)

monkey0506

In the sake of objectivity (and in no way allowing myself to be influenced by the fact that Khris is one of my nemeses), it's fair to say that the description in the manual could use some elaboration.

The leading zeroes in the text-strings (e.g., "&01 Hello World!") aren't problematic because the engine is trimming out the digits and then converting that to an integer (in AGSpeek: String s = "01"; int speechNum = s.AsInt; ), but when the engine is looking for the actual speech file it's using a filename without leading zeroes (e.g., "EGO1.wav"). That's why this all came up in the first place, and the manual doesn't clearly state that the formatting should not have leading zeroes or padding.

Eh.

Khris

I actually agree that switching to a numbering system of CHAR0001, CHAR0002, etc. makes more sense, since sorting that list alphabetically doesn't any longer produce the current non-order of CHAR1, CHAR10, CHAR11, CHAR2, etc.

But putting all kinds of superfluous "contents is hot" warnings all over the manual is stupid. And we already know that people don't read them anyway. Just think about how often we get the infamous "why is my dialog not called until after my other commands" question.

Also, I'd rather gnaw off both my arms at the shoulder than request a manual change due to me screwing up like this. That's why I'm so unforgiving here. It's a symptom of the general attitude of "everything else is broken, not me though". And I simply despise it.

And monkey:
Nemesis, really?
And claiming that your subjective opinion about the change is objective doesn't make it so.

Adeel

You're right, monkey_05_06. :)




Quote from: Khris on Thu 10/10/2013 13:33:53
Also, I'd rather gnaw off both my arms at the shoulder than request a manual change due to me screwing up like this. That's why I'm so unforgiving here. It's a symptom of the general attitude of "everything else is broken, not me though". And I simply despise it.

Its your way of taking it like that. I just wanted a warning line to be added, if in the unlikely case someone else ever gets stuck in the similar problem as mine. If this line saves even one person from the trouble, then it will be worth it. I don't want anyone wasting their time, thinking what went wrong. So, he/she can gladly move forward to learn something else and/or progress with their game. Time is most important, after all. Yes, I'm thinking about the very odds here, but you can't deny that it isn't possible!

And please, don't start about being forgiving or unforgiving here. You're not a king whose forgiveness is necessary for the puny citizens to live. I knew it was my fault i.e. I were doing something wrong (which is why I posted it here). I just requested the addition of that line because I wanted to save at the very least one future AGSer from this trouble. My fault, apart from including a zero in the filenames, was to: simply care.

Also, you can't seem to get out of the delusion that I want that paragraph to be included for myself. Why would I want a line to be added in the manual for myself? I can remember easily what I'm told (thanks once again, CW & monkey). And if I really needed to take written notes, can't I just copy and save these advices in a document? (roll)

Crimson Wizard

Quote from: Khris on Thu 10/10/2013 13:33:53
But putting all kinds of superfluous "contents is hot" warnings all over the manual is stupid.
But why is this stupid in this case? If program expects very precise number format, that should be reflected in documentation. Of course, it is not hard to make few experiments, but the sole fact that this may require experimentation already shows that the documentation lacks in detail.

Khris

Adeel, this isn't about whether I forgive you or not, the entire notion is ridiculous. I merely explained why requests like these make me angry. I can't help it, I hate this entire culture of accommodating every little shitty whim just because it's polite or whatever.

If everybody else thinks that cluttering up the manual with shit like that is the way to go instead of expecting people to actually use whatever's between their ears, go ahead. It's not like you need my blessing.

Crimson Wizard

#18
Quote from: Khris on Thu 10/10/2013 15:01:23
If everybody else thinks that cluttering up the manual with shit like that is the way to go instead of expecting people to actually use whatever's between their ears, go ahead.

Following your vision of what documentation should be we probably need to remove these lines from the manual:
QuoteNOTE: You cannot use speech file numbers above 9999. That is, you can have EGO1.OGG all the way up to EGO9999.OGG, but not EGO10000.OGG or higher.

Really, why tell this to the user? They have brains, don't they? If they make voice tag >10000 and it won't work, they will realize it is an engine's limitation and will proceed using voice numbers accordingly.


Khris, you keep telling that no one is reading the manual. But while you can count those who did not read (properly, or at all), can you really count those who did read manual and therefore did not ask question on forum?

Khris

#19
I'm sure you realize that's not a valid comparison.

Edit: I see your second point, but since I'm not suggesting to take anything out of the manual, I fail to see its relevance.

Edit 2: another reoccurring question is how to distinguish which inventory item was used. In my book, this is clearly something that should've been added to the tutorial years ago. And doing so was suggested multiple times, yet it's still not in there, afaik.
How come?

SMF spam blocked by CleanTalk