Text to Speech with AWS Polly in Unity!

Поділитися
Вставка
  • Опубліковано 29 вер 2024

КОМЕНТАРІ • 83

  • @itox8924
    @itox8924 10 місяців тому +7

    Is there anything additional I need to do to use Oculus Quest 3 in my build? It runs fine on Windows, but when I build it on Oculus, it doesn't speak.:) Please tell me how.

  • @Camilosolanoro
    @Camilosolanoro 7 місяців тому +2

    esto no me funciona con oculus y unity no suena el audio porque???

  • @jamesaldridge1128
    @jamesaldridge1128 Рік тому +12

    Why do you not have way more views? These are amazing tutorials

    • @sgt3v
      @sgt3v  Рік тому

      Thank you James :0)

  • @Robloxzz
    @Robloxzz Рік тому +2

    Thank you for the nice video :)
    I followed your instructions and put the code I wrote in unity and ran it. But when i press the play button in unity there is no AI voice and no response.
    Why did this happen? Can you give me some advice?
    (There seems to be no problem in the code, and there is no problem in the unity console.)

    • @sgt3v
      @sgt3v  Рік тому +1

      Can't really know, might be related to your environment. Make sure you get text response from OpenAI

  • @윤예진-z1v
    @윤예진-z1v Рік тому +3

    Hi, Thanks for your amazing video!
    I got a error message such as "InvalidOperationException: Cannot access the .audioClip property of an aborted DownloadHandlerAudioClip
    UnityEngine.Networking.DownloadHandlerAudioClip.GetContent".. how can I solve this?..Help me please. ;)

    • @sgt3v
      @sgt3v  Рік тому +1

      You need to assign the clip when the download is completed, you might have wrong order of operations it tries to access audio clip out of using block of the web request maybe.

    • @JaceC70
      @JaceC70 Рік тому +1

      @@sgt3v I am also getting this error. I've checked the code countless times and I don't see a difference, I see it is writing the file in the Application.persistentDataPath}/audio.mp3 and I can play it manually, so I know it's working to that point. However, I'm unable to read it in code despite making sure while(!op.isDone) await Task.Yield(); is correct. Any other ideas? Could this be a Mac permissions issue?

    • @JaceC70
      @JaceC70 Рік тому +3

      Ok, I found the issue make sure you add "file://" in the URI. So you end up with with UnityWebRequestMultimedia.GetAudioClip(uri: $"file://{Application.persistentDataPath}/audio.mp3", AudioType.MPEG)

    • @riovk4291
      @riovk4291 Рік тому +2

      @@JaceC70 Thank you so much. I spent ages struggling with this bug. Just a tip for others with this problem, when I was doing it, I needed to add the "file://" ONLY to where we read the file. Adding it to where we write the file caused its own new issue.

    • @williamowens6049
      @williamowens6049 Рік тому +1

      @@riovk4291 Thank you! This little detail saved quite a bit of time.

  • @_sz_405
    @_sz_405 Рік тому +3

    Any tests with webgl? What's the lag like for 30-40 sec speech?

    • @sgt3v
      @sgt3v  Рік тому +2

      Unfortunately, ASW Polly breaks in WebGL right now. I reported it and am waiting.
      github.com/aws/aws-sdk-net/issues/2578

  • @sean-liu
    @sean-liu Рік тому +2

    You made a tutorial about NPC with ChatGPT, two tutorials about Text2Speech & Speech2Text, I almost know what you gonna make in the next video! Really looking forward to it!

    • @sgt3v
      @sgt3v  Рік тому +3

      👀👀

  • @loneillrt
    @loneillrt 8 місяців тому +1

    Have you managed to get OpenAI's Text To Speech working in Unity?

  • @squer1000
    @squer1000 Рік тому +1

    Guys like this making world a better place....

  • @adrianortiz5224
    @adrianortiz5224 6 місяців тому

    Why not work for android?

  • @NightcoreGR16
    @NightcoreGR16 8 місяців тому

    If it's not working choose another region... I couldn't find why my audio is not playing while I'm doing everything just like the video and I needed EUCentral even though I'm in Greece :,)

  • @lsqnet
    @lsqnet Рік тому +1

    Hi, Does this support Unity WebGL or WebXR?

    • @Nnadi_II
      @Nnadi_II 10 місяців тому

      @sarge please

  • @권승준-g7m
    @권승준-g7m 7 місяців тому

    ArgumentException: Illegal byte sequence encounted in the input

  • @ciaronfitzpatrick8011
    @ciaronfitzpatrick8011 4 місяці тому

    These tutorials are excellent! Thank you so much for making them!

  • @joybeatgames6075
    @joybeatgames6075 Рік тому

    Thank you for making this awesome video. I encountered an issue that I would appreciate your assistance with. I have some pops in the audio clip sound. I think the write function saves the file at 40kps while it is processed as 24kps on AWS Poly.this might be the problem.

  • @Nnadi_II
    @Nnadi_II 10 місяців тому

    hello awesome video works well, please how can i make it that instead of it being called on start it gets called when i call it or push a button. thank you

  • @Johnessy
    @Johnessy Рік тому

    I am getting 2 errors that i just cant seem to figure out.
    Assembly 'Assets/Plugins/AWSSDK.Polly.dll' will not be loaded due to errors:
    Unable to resolve reference 'System.Threading.Tasks.Extensions'. Is the assembly missing or incompatible with the current platform?

    • @sgt3v
      @sgt3v  Рік тому

      You might be using an older version of Unity or .net that does not have `System.Threading.Tasks.Extensions` library. You might need to download the DLL here docs.aws.amazon.com/sdk-for-net/v3/developer-guide/unity-special.html in the list

  • @asoasiri
    @asoasiri 10 місяців тому

    What do I write in the script to make him speak Arabic?

  • @asoasiri
    @asoasiri 10 місяців тому

    How do I make him speak Arabic?

  • @asoasiri
    @asoasiri 11 місяців тому

    How do I make him speak Arabic?

  • @SelfSimilarJosh
    @SelfSimilarJosh Рік тому +1

    Thank you very much! Excellent explanation. I followed each step and it's working on my end. I'm surprised to say I found this organically through a search, and only two days after it was uploaded!

    • @sgt3v
      @sgt3v  Рік тому +1

      Hi Joshua glad to hear that it worked without a problem. I hope that youtube does it's recommendation magic and more people can get use out of this video series 😄 I myself found it hard to implement certain things at point, so also wanted to share my findings so others do not struggle the way I did :0)

    • @SelfSimilarJosh
      @SelfSimilarJosh Рік тому

      @@sgt3v Certainly, let's hope the algorithm does what it does best. I found this on Google by searching almost your exact video title.
      Did you by chance experiment with actually building this model to an Android Device?

    • @sgt3v
      @sgt3v  Рік тому +2

      @@SelfSimilarJosh the example as is wont work in android since file save path is slightly different.
      before making download request URL can be corrected like this so it works everywhere:
      #if UNITY_ANDROID
      audioPath = $"jar:file://{Application.persistentDataPath}/audio.mp3";
      #elif UNITY_IOS || UNITY_OSX
      audioPath = $"file://{Application.persistentDataPath}/audio.mp3";
      #else
      audioPath = $"{Application.persistentDataPath}/audio.mp3";
      #endif

    • @SelfSimilarJosh
      @SelfSimilarJosh Рік тому

      @@sgt3v That's awesome. Thanks for the reply - I'm actually going to try it out right now.

    • @hamnakhawar219
      @hamnakhawar219 10 місяців тому

      @@SelfSimilarJosh has this built on andriod?

  • @mohammadmsh-x2z
    @mohammadmsh-x2z 11 місяців тому

    can i use this in webGL?

  • @fofoasiri404
    @fofoasiri404 10 місяців тому

    How talk arabic😢

  • @shadaaan
    @shadaaan Рік тому

    Assets\tts.cs(18,56): error CS0103: The name 'RegionEndpoint' does not exist in the current context
    i am getting this error, installed the plugins but still.

    • @sgt3v
      @sgt3v  Рік тому

      You need to pick the region that is assigned in your AWS account.

  • @antonolivaresjuanjose2992
    @antonolivaresjuanjose2992 Рік тому

    You are de number one. Thank you very much

  • @haxpor
    @haxpor Рік тому

    Interesting approach you suggested from start to generate an audio for secret keys then fetch it from server. Anyhow, cheers for the video. Sparks further learning material. Thanks!

    • @sgt3v
      @sgt3v  Рік тому

      yep as long as secret keys involve, it's better to take the safe road and hide them behind a backend server.

  • @alokdubey3052
    @alokdubey3052 Рік тому

    Hi , can you suggest me any open source tts for unity3d.

    • @sgt3v
      @sgt3v  Рік тому

      There is none that good that I know of.

  • @dionysoft
    @dionysoft Рік тому

    birşey sorcam hocam madem bu kadar iyisin c# da unity de bayada bilgili ve kendini geliştirmişssin neden diğerleir gibi bir oyun yapıp parayı kırmıyorsun

    • @sgt3v
      @sgt3v  Рік тому +1

      Ahaha zaten calistigim cok iyi bir isim ve projem var, konu iyi oyun ya da kotu oyun cikarmak. Hizlica kendime yakistirmayacagim kotu bir oyun cikarmak mantikli buldugum bir fikir degil. Prensip ve felsefe meselesi. Istanbul depremini dusun, kendine muteahit diyen bir suru insan bina yapti ve yikildi o binalar, ben de uzerine derinlemesine dusunup vakit harcayamayacagim bir ise girmeyi dusunmem, onemli olan urunun benim istedigim kalitede olmasi.

    • @dionysoft
      @dionysoft Рік тому

      @@sgt3v cidden zaman ayırıp bu uzun mesajı örneklerle anlatman bile beni mutlu etti çok güzel özetledin cidden fakat bir soru daha sormak istiyorum kardeşin olarak hocam senden yaşca küçüğüm biliyorum bende dijital oyun tasarımı okuyorum türkiyede sence bir şirkette çalışarak da refah seviseyinde gelirler kazanılabilirmi bu sektörde bir oyunla patlamadığın sürece hocam teşekkürler şimdiden

    • @sgt3v
      @sgt3v  Рік тому +1

      @@dionysoft Malesef senin benim gibi insanlara hersey altin tepside gelmiyor, calisip ogrenip kendini gelistirip bir yandan da kendin icin birseyler yaparak donguyu kirmaya calisabilirsin. Aniden zengin olman gerekmiyor. Kendini hem profesyonel alaninda hem de sosyal alanda gelistirirsen herhangi bir sirkette aranan ve deger goren kisi olabilirsin. Biraz zaman ve emek isteye bir surec ama kendine saygini ve inancini da arttiran bir surec.

    • @dionysoft
      @dionysoft Рік тому

      @@sgt3v teşekkürler hocam 💕

  • @FDany90
    @FDany90 Рік тому

    Amazing. Keep Going

  • @siliwang6180
    @siliwang6180 Рік тому

    Thank you for the guide. But I have problem when I build Android apk. The polly works well in the editor and PC application. But the Android doesn't work. Do you have the same issue?

    • @sgt3v
      @sgt3v  Рік тому

      Hi, do you get any error messages? You could import the Android LogCat package and see if any Unity errors appear when making a request.

    • @elmehdidair
      @elmehdidair 5 місяців тому

      you find the solution

    • @seancoyle6920
      @seancoyle6920 2 місяці тому

      Try “development build” under build settings

  • @taniazaheer3271
    @taniazaheer3271 Рік тому

    Great Video. Successfully made Aws account by following your instructions. However, I implemented the same TextToSpeech code but it doesn't work on my side. Whenever I drag the textToSpeech script in the inspector, it doesn't contain audio source in it :( Kindly help me out to fix this issue.

    • @sgt3v
      @sgt3v  Рік тому

      Around 26:43 I add the audioSouce as a exposed private field, maybe you missed that part?

    • @taniazaheer3271
      @taniazaheer3271 Рік тому

      ​@@sgt3v No, I even added that part as well. Would you mind looking at your Instagram message requests? I have mentioned the complete details of the error that I am facing and I even sent you the screen shots of my code there. Kindly help me out

    • @taniazaheer3271
      @taniazaheer3271 Рік тому

      @@sgt3v would you be kind enough to share the whole unity file with me? 🥺

  • @aknerkan3428
    @aknerkan3428 Рік тому

    Clear instructions, Great tutorial!

  • @farahzehra8952
    @farahzehra8952 Рік тому

    Thanks again for the wonderful video series you are making. One quick question, is there any number of characters limit associated with AWS Polly for Text-to-Speech conversion?

    • @sgt3v
      @sgt3v  Рік тому

      As far as I remember it must be 3000 characters. You can check the docs here to make sure: us-east-1.console.aws.amazon.com/polly/home/

  • @tripnils7535
    @tripnils7535 Рік тому

    Worked like a charm. Thank you for providing this tutorial.

    • @sgt3v
      @sgt3v  Рік тому

      You're welcome!

  • @aidenyannn
    @aidenyannn Рік тому

    Great tutorial!

  • @JaceC70
    @JaceC70 Рік тому

    Great example, thank you! Is this likely to work on iOS? - I failed so far but do have it working on the Mac.

    • @sgt3v
      @sgt3v  Рік тому

      Unfortunately I do not have a Mac and iPhone in my possession so I wont be able to test.

    • @JaceC70
      @JaceC70 Рік тому +1

      @@sgt3v thanks for getting back to me. I guess it’s down to the Amazon DLL support for AOT compilation. I’ll do some investigation and report back for anyone else trying.

    • @JaceC70
      @JaceC70 Рік тому

      I did manage to get it working on the iPhone. I'm embarrassed to admit I forgot to set [Application uses Wi-Fi] to YES and you'll also need to add [Wi-Fi] in the [Required device capabilities] in the Info.Plist. Finally, I also needed to add s link.xml file that contains:

      Without this, I was seeing "MissingMethodException: Method not found: 'Default constructor not found...ctor() of Amazon.Util.Internal.PlatformServices.NetworkReachability'." in the Xcode console. Hope it helps someone else trying the same.
      In short, Sarge's great demo works on the iPhone. Thank you, Sarge!

    • @sgt3v
      @sgt3v  Рік тому +1

      @@JaceC70 Glad to hear that it worked! I'm sure your finding will help other who encountered the same issue, thank you!

  • @srijana6016
    @srijana6016 Рік тому

    how to integrate with this to chat gpt response

    • @sgt3v
      @sgt3v  Рік тому +1

      Hi, I will make a video for that this weekend.

    • @sgt3v
      @sgt3v  Рік тому

      Hi Priyam, I make the videos whenever I fnd the time, probably I will work on it in the weekend but can't promise.

  • @michealnwankwo8300
    @michealnwankwo8300 Рік тому

    Thanks Sarge you have really been helpful,
    Thanks Man 🙏🏾🤗.

    • @sgt3v
      @sgt3v  Рік тому

      You're welcome!

    • @michealnwankwo8300
      @michealnwankwo8300 Рік тому

      @@sgt3v hello sarge thanks again for this great video, i tested mine but it gave me this error "HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown." can you help please

    • @michealnwankwo8300
      @michealnwankwo8300 Рік тому

      i'm also very sure i got my access key and secret access key right

    • @sgt3v
      @sgt3v  Рік тому

      @@michealnwankwo8300 can you share your code block and the whole error stack trace?

    • @michealnwankwo8300
      @michealnwankwo8300 Рік тому

      @@sgt3v ok sarge, thanks