Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: greg on Thu 05/07/2012 20:50:01

Title: Playing a speech file as an audio clip.
Post by: greg on Thu 05/07/2012 20:50:01
Is there any way to play a speech file (packaged in speech.vox) as an audio clip rather than as speech?

For example, to play a speech file as speech, I'd use cEgo.Say("&1234 I speak therefore I am."), which then plays EGO1234.ogg (which was packaged into speech.vox at compile time).

But is it possible to play EGO1234.ogg directly as an audio clip, i.e. to access that particular sound file within speech.vox?  Right now, my workaround is to import the speech file as an audio clip (e.g. aEGO1234) and then play it; but that's clunky for several reasons (e.g. duplicates data, not extensible since you have to import each sound manually in the editor, etc).

By the way, my goal in all this is to play a speech file in a non-blocking manner.  (I'm writing my own version of SayBackground that includes sound.)

Thanks,
Greg
Title: Re: Playing a speech file as an audio clip.
Post by: monkey0506 on Thu 05/07/2012 23:45:40
Presently speech files cannot be played directly, only via the blocking Character.Say command. It's something that I think certainly needs to be reviewed at some point, but for right now we're doing good trying to hold together any form of organization as to getting things done with the engine. There's a lot of work left to do before we can really start implementing major changes like this (revamping the speech system).
Title: Re: Playing a speech file as an audio clip.
Post by: greg on Fri 06/07/2012 03:05:05
Great, thanks for the clarification!
Title: Re: Playing a speech file as an audio clip.
Post by: monkey0506 on Fri 06/07/2012 06:55:31
In the mean time, you may consider even implementing your own speech system using a separate AudioType for speech and some custom commands instead of the built-in speech system. I haven't actually pulled it up myself, but you may also want to look at the SpeechCenter plugin as it has some great features that may be useful to you as well.
Title: Re: Playing a speech file as an audio clip.
Post by: Crimson Wizard on Mon 09/07/2012 22:27:24
By the way, this was supposed to be implemented.
I found there is a function PlaySpeech prepared in the engine code, but currently it does nothing.