Forum rules - please read before posting.

Asset bundles for speech

Hi there :)
I have possibly a hundred audio files that are all speech, there is no optimization whatsoever (so no asset bundles or saveable data) etc as I have no idea how it works but I'm wanting to try it out. I dont have any subtitles/dialogue for the speech audio in particular though, the audio only plays throughout gameplay in different missions so I'm wondering if I should still go about packing them into asset bundles or how it all works?

So far I've managed to put all these speech audio files into an asset bundle called "voices" and put the files output from building it into "Streaming Assets" but from there I'm stuck because it looks like I need to have subtitles connected to it? Which I dont haha

Thanks!

Comments

  • If you want to make use of AC's asset bundle loading, they'll need to go through AC's speech system.

    That's not to say you can't load asset bundles without AC - but you'll need to load them through custom code, e.g:

    string bundlePath = Application.streamingAssetsPath + "/MyBundleName";
    var bundleLoadRequest = AssetBundle.LoadFromFileAsync (bundlePath);
    yield return bundleLoadRequest;
    AssetBundle myAssetBundle = bundleLoadRequest.assetBundle;
    

    However, you will also need to then load such assets from within the bundle as well - again through custom code.

    AudioClip clipObj = myAssetBundle.LoadAsset<AudioClip> (fullName);
    

    See Unity's own docs on Asset Bundles for more on how to manage them through code, but it may be easier to switch to AC's speech system - it's not necessary for subtitles to be displayed, and it can be used for audio only.

    On the topic of speech optimisation, however, I'd recommend going with Addressables, which is Unity's upgraded Asset Bundle system. AC's speech system also has support for this - see the Manual's "Speech audio" chapter for details.

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.