Author Topic: Playing a speech file as an audio clip.  (Read 333 times)  Share 

Playing a speech file as an audio clip.
« on: 05 Jul 2012, 20:50 »
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

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: Playing a speech file as an audio clip.
« Reply #1 on: 05 Jul 2012, 23:45 »
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).
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Re: Playing a speech file as an audio clip.
« Reply #2 on: 06 Jul 2012, 03:05 »
Great, thanks for the clarification!

monkey_05_06

  • AGS Project Admins
  • Has left the building.
Re: Playing a speech file as an audio clip.
« Reply #3 on: 06 Jul 2012, 06:55 »
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.
Let's be honest. Most people suck at coding. I suck at coding, but at least my code is readable. To Hell with anyone too lazy to maintain consistent formatting in their code. I could deal with bad interfaces and structure if I could even read your horrible code. And that's putting it nicely. -monkey

Crimson Wizard

  • AGS Project Admins
  • not et suppotreD
    • I can help with translating
    •  
Re: Playing a speech file as an audio clip.
« Reply #4 on: 09 Jul 2012, 22:27 »
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.