Interesting-exe / sponge-ai

Creates AI generated Spongebob episodes
52 stars 18 forks source link

Can't get audio or subtitles working #4

Closed Rooklz closed 1 year ago

Rooklz commented 1 year ago

So half of this is working for me, Uberduck is generating as it's using tokens and GPT is also generating outputting to "next"

However I keep getting this error no matter what I do `NullReferenceException: Object reference not set to an instance of an object AIThing+d__16.MoveNext () (at Assets/Scripts/AIThing.cs:249) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)

d__13:MoveNext() (at Assets/Scripts/AIThing.cs:168) UnityEngine.UnitySynchronizationContext:ExecuteTasks()` ![image](https://github.com/Interesting-exe/sponge-ai/assets/17833590/ddd5c626-288e-44d7-ad35-fbe96dfb9b88) I have these filled out and my project currently looks like this: ![image](https://github.com/Interesting-exe/sponge-ai/assets/17833590/032bdec5-304f-49ba-92f4-dd7a2aa86189) When I run the project the video plays as expected and everything generates but still no audio or subtitles Is there something I'm missing? AIThing, Dialogue and Topics are sat in a scripts folder with AIThing put inside a blank gameobject
NJWXCentral commented 1 year ago

I'm having the same issue. It's sucking the credits up weirdly too. Like 100 TTS credits in only a few seconds before I hit the pause button.

Rooklz commented 1 year ago

I'm having the same issue. It's sucking the credits up weirdly too. Like 100 TTS credits in only a few seconds before I hit the pause button.

Oh wow same actually I've used 256 after only having it run for 5 seconds xd

Interesting-exe commented 1 year ago

I should've made it clear and also probably add an if. the name of gameobjects of your characters have to be the same as the character variable in the if statements at the "Generate(string topic)" method. so if you haven't messed with the code the gameobject's names should be: "spongebob", "patrick", "mrkrabs", "squidward" and "sandy".

Interesting-exe commented 1 year ago

also, i'd recommend decreasing max_tokens at line 179 to around 25-50 while testing so you dont use too many render credits

Interesting-exe commented 1 year ago

I've updated the code so it wont crash even if you dont have the same gameobject names hope it works for you guys now