Forum rules - please read before posting.

[Feature Request] Precise control over speech audio path distribution

edited June 2018 in Engine development
I wanted to request a precise control over speech audio path generation. Since structuring and storing various translations and audio files is difficult. It's important to have a structure that fits the project the best. My variant would have been, Resources/Speech/SceneName/OriginalText. But I understand that every project would have a different case and implementing each one would be a nightmare, also since for example there is no guarantee that OriginalText is unique, some of the variants would even break other people projects. So I thought that maybe it would be an option to enable an entry point that allows for a custom function that generates a path for each line? Basic projects will probably suffice with the current options for audio files distribution and advanced projects probably have the necessary skill and team to write their own folder structure script. So would it be possible to get an option of an overridable method, that generates audio paths for speech lines?

EDIT 1: The passed down parameters should probably include desired language, all other languages, description, id, etc. Including all other languages is useful when you make some hidden 'languages' that contain meta data for the speech line, that meta-data is useful to generate custom audio line addresses.


  • edited June 2018
    Exact location can already be assigned by unchecking Auto-name speech audio files?, since you then connect audio to lines by assigning files manually.

    The latest release allows you to control the name of "Speech" Resources subfolder, but only as an exposed textfield.

    Having a more generic "path generator" function would be more powerful, but does have the potential for knock-on problems.  For example, the Speech Manager's Give matching speech lines the same ID? option allows for the same audio file to be shared by lines that have the same speaker/text etc, so scene placement then becomes unnecessary.

    Since data about a line's ID, scene, etc is already present in its own SpeechLine class instance, it'd probably best to just pass that along with the language as the parameters.  I'll have a look into it.

    I don't follow your "other languages" explanation, but you can retrieve data about the available languages by reading the SpeechManager:

  • I see, unchecking auto-name speech audio files opens the option of directly linking items. That is an option, but a bit of a clumsy one.

    As for "other languages" variant:
    I for example have Language #1 - English, Language #2 - Lithuanian, Language #3 - Group (path). In Language #3 I store part of the path where the speech line is found eg.: Resources/Speech/English/<Language #3 value>/<Original text>.mp3  or Resources/Speech/Lithuanian/<Language #3 value>/<Original text>.mp3

    That's what I mean with meta-data in languages. I had the same functionality for  Description, before it was implemented internally (Language #4 was description field). And then when choosing languages ingame I'd simply hide these meta-data "languages". That is also the reason why when writing my custom method for audio path retrieval I'd need not only the language I want to retrieve in, but other "languages" as well, since one of them may be the meta-data column/"language".

  • By other "languages", do you just mean their label?  A Global String Variable could be used instead if so.

    Either way, again - all such data can be retrieved via the Speech Manager, and the SpeechLine class has all information about the line itself.  Would the following suffice?

    private string GetAutoAssetPathAndName (SpeechLine speechLine, string language, bool forLipSync)
            return "Speech/" + language + "/" + speechLine.lineID;

  • Yes, that would be more than enough, such method would be great.
  • v1.63.1 should allow for this.  Here's an example usage script:
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.