Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon Polly for Unity #627

Closed
hasanbayatme opened this issue Apr 24, 2017 · 42 comments
Closed

Amazon Polly for Unity #627

hasanbayatme opened this issue Apr 24, 2017 · 42 comments
Labels
feature-request A feature should be added or improved. Unity

Comments

@hasanbayatme
Copy link

How do i use Amazon Polly in Unity?

@gokarnm gokarnm added the feature-request A feature should be added or improved. label Apr 24, 2017
@gokarnm
Copy link
Contributor

gokarnm commented Apr 24, 2017

Amazon Polly is currently not supported on the AWS Mobile SDK for Unity.

@hasanbayatme
Copy link
Author

hasanbayatme commented Apr 25, 2017

How do i use the .NET version in Unity? because Unity is in .Net so it should work well on it.

EDIT: Why we can't use .NET version in Unity?

@gokarnm gokarnm added the Unity label Apr 25, 2017
@gokarnm
Copy link
Contributor

gokarnm commented Apr 25, 2017

If you are asking if the SDK DLLs for .NET 3.5 or 4.5 can be used for Unity, you cannot, because Unity targets Mono which is equivalent to .NET Framework 2.0. Also, the APIs exposed in SDK that targets 3.5 are quite different from the async APIs available in the Unity SDK.

@hasanbayatme
Copy link
Author

Thanks @gokarnm..
So i can't use SDK DLLs in Unity because Unity uses mono that uses older .NET versions.

@OlafLablike
Copy link

OlafLablike commented May 19, 2017

Hi @gokarnm, are there any plans to support Polly in Unity?

@Logodaedalus
Copy link

Given that the new Unity 2017 has the 3.5 Runtime, or the experimental one that says it's 4.6 equivalent, are there plans to make Polly available on it? Seems like it would be a well-used plugin if so!

@Dunnbar
Copy link

Dunnbar commented Aug 27, 2017

+1, I would like to know if it's planned to make Polly available for Unity 2017.

@olomorolo
Copy link

+1, Polly for Unity 2017 would be great!

@whipsmartgames
Copy link

Is there any way to find out from Amazon if using this in Unity 2017 will work? or when support for it will happen/

@hasanbayatme
Copy link
Author

Can we make an Amazon Polly SDK for Unity using Amazon Polly REST API?

@hasanbayatme hasanbayatme reopened this Sep 18, 2017
@arun02139
Copy link

Bump also hopefully that the plugin will get support in the new Unity. I have budget to pay for this upgrade, any interested parties please email me at arun.mehta@plusone.space (will give back to community to use as well ^^)

@azinicus
Copy link

azinicus commented Oct 7, 2017

Double bump... this would be pretty awesome for VR applications we're creating

@whipsmartgames
Copy link

Yes being able to add voices around the player in BR is exactly what I want this for

@normj
Copy link
Member

normj commented Oct 9, 2017

I can see how this would be a really cool service to use with Unity. Unfortunately our team resources are consumed right now on other tasks for our upcoming AWS re:Invent conference. It is an easy flag to set in our code generators to produce a Unity Polly assembly the problem is we just don't have the bandwidth to test it right now.

I really don't like blocking users though, so if you folks are willing to test it here is a one off build I did that enabled Polly in the Unity code generator.

https://aws-net-sdk.s3.amazonaws.com/preview/UnityPollySupport.3.3.2.4.zip

For anybody that uses it I'd appreciate feedback on any issues you have with it.

@olomorolo
Copy link

Hi, has anyone got this package linked by normj working and could give us a quick guide how to use it in Unity? :)
Thanks!

@azinicus
Copy link

azinicus commented Nov 3, 2017

Unfortunately we haven't tried yet... it might need the newer experimental .NET 4.6 option in player settings in Unity 2017.1+ but not 100% sure. Also, it's not quite asset plug n play ready, it would take some hacking to make it work with a game. Let us know if you get to it!

@diegodias
Copy link

diegodias commented Dec 19, 2017

I have used it with Unity 2017.2.1 (latest right now), and it works. Going to try with the 2017.3.0 which just launched.
@normj Probably not the correct place to ask... but can you provide a similar build one off build to enabled Lex in the Unity code generator?

@azinicus
Copy link

@diegodias Awesome, any chance you could share on how you got it to work? orrrr pretty please a unity package to share with the community???

@olomorolo
Copy link

@diegodias +1 to @azinicus request :) any chances for sharing some guide on how to setup Unity with AWS to get it work with Polly? Would appreciate it very much! Thanks!

@diegodias
Copy link

@olomorolo @azinicus Sure, will do, just give me a couple days.

@olomorolo
Copy link

@diegodias many many thanks! I look forward to it, but of course - take your time :) Cheers!

@IanPhilips
Copy link

@diegodias Hi, just joining the conversation, any possibility of a unity package for this? thanks!

@diegodias
Copy link

@azinicus @olomorolo @IanPhilips (and any others that may be interested) package is attached... (you just need to create a cognito identity and use it).
Sorry for taking too long to post here. I also had to change the code a bit to support Unity 2017.3.0 . Code is by no means supposed to be optimized or the best implementation.
Hope it helps you.
AWSPollyMin.zip

@azinicus
Copy link

Awesome, thank you @diegodias !! Will let you know how it goes

@IanPhilips
Copy link

@diegodias thanks for the package! With a fresh unity 2017.3.0.f3 project and loading the scene I'm getting: Errors during import of AudioClip Assets/Audios/Generated/1517014938.mp3: FSBTool ERROR: Failed decoding audio clip.
The file is there but it looks like it's empty. My IAM role for my user has "AmazonPollyFullAccess"

ahh-for those who are getting the same error, make sure all of your regions match your user's region. Now it works! Thanks again, Diegodias

@olomorolo
Copy link

thanks so much @diegodias ! I'll give it a try 👍

@NawarRajab
Copy link

@IanPhilips I'm getting the same error. I've set the region to USWest2 in AWSPolly. It seems responseObject.Response is null.

@olomorolo
Copy link

@normj, @diegodias it's been a while but I finally gave it a try :) It works great on Desktop mode and in Editor (thanks a lot for sharing the package!) but I can't get it work when building on iOS or Android.

Should I add some additional libraries manually maybe? I tried to additionally import regular AWS packages for Unity (that ones: http://sdk-for-net.amazonwebservices.com/latest/aws-sdk-unity.zip) but it didn't help. I'm still getting this error when deploying on mobile:

NullReferenceException: A null value was found where an object instance was required. at Amazon.Runtime.Internal.UnityMainThreadDispatcher.ProcessRequests () [0x00000] in <filename unknown>:0 at Amazon.Runtime.Internal.UnityMainThreadDispatcher.Update () [0x00000] in <filename unknown>:0

If you would have any ideas how to fix the issue I would appreciate your help very much :)
Thanks!

@KieranK6
Copy link

KieranK6 commented Mar 31, 2018

Hi,
I tried implementing this but keep on getting error when importing audio clips. They are failing to decode. Any ideas why this is? Another user said they had this because of having the wrong region set but as far as I know my regions are set correctly.
Thanks

Edit: Solved

@lukker234
Copy link

@KieranK6 How did you solve this problem? i've got the same problem but i don't know how to fix it.

@KieranK6
Copy link

@lukker234 I set up an IAM role on AWS as IanPhilips said above. I also uncommented two lines that flushed and then closed the fileStream. Let me know if it works or not I can try to give more detail

@RigosaaCL
Copy link

@IanPhilips Hi, what you exactly mean with "make sure all of your regions match your user's region". I have created a "us-west-2:xxxx" and a "us-east-1:xxxx" Cognito credentials and changed AWSPolly.cs to make the 'RegionEndpoint' variable match the credential, but still getting the zero length mp3 file and the 'Failed decoding audio clip' error. Don't know what to do next.

Could someone explain what needs to be done?

thanks.

@IanPhilips
Copy link

IanPhilips commented May 8, 2018

@RigosaaCL @NawarRajab It's been too long and I don't have that computer anymore but from what I remember there was a spot in the unity code to specify which region I was in, and in the AWS console for the polly service I had to specify a region and in the IAM role I had to specify a region. Only when all (three) of these matched (including the region specified in the Unity C# code) did the example work for me.

@willt
Copy link

willt commented Apr 20, 2019

I see this issue is still opened. Is Polly working now in unity or not?

@easchimidt
Copy link

I'm using Amazon Polly with recent versions of Unity with .Net 4x Equivalent, and it's working perfectly. I'm using this DLL . Didn't need to do anything else but import inside my Unity project (of course, you will need also AWSSDK.Core, available here.

@klaytaybai
Copy link
Contributor

Thanks for the update. This seems to be available now, so I'm closing this issue.

@renanmgs
Copy link

renanmgs commented Nov 3, 2019

@RigosaaCL @NawarRajab It's been too long and I don't have that computer anymore but from what I remember there was a spot in the unity code to specify which region I was in, and in the AWS console for the polly service I had to specify a region and in the IAM role I had to specify a region. Only when all (three) of these matched (including the region specified in the Unity C# code) did the example work for me.

Hey @RigosaaCL , have you managed to get around this problem? Im getting the 0kb files as well, and everything is set. In the script and my Cognito server are on the same region, as @IanPhilips told!

@RigosaaCL
Copy link

@RigosaaCL @NawarRajab It's been too long and I don't have that computer anymore but from what I remember there was a spot in the unity code to specify which region I was in, and in the AWS console for the polly service I had to specify a region and in the IAM role I had to specify a region. Only when all (three) of these matched (including the region specified in the Unity C# code) did the example work for me.

Hey @RigosaaCL , have you managed to get around this problem? Im getting the 0kb files as well, and everything is set. In the script and my Cognito server are on the same region, as @IanPhilips told!

Hi @renanmgs, yes I did, I finally managed to connect to any AWS service from Unity by using my own compiled DLL. That process is the same I'm currently using, as the compiled DLLs are still working, though I don't know if the official AWS SDK for .NET is working.

I used this GIT Fork to compile every DLL I needed, using Visual Studio:
https://github.com/rms80/aws-sdk-net

Hope it works for you.

Regards,
Rigo.

@zerozinczero
Copy link

@RigosaaCL I'm trying to get Amazon Polly working in my editor too, but so far I've had no luck. I've followed all the instructions listed on this page, except for the DLLs. I was wondering what files you used to compile your own DLLs? Looking at Unity I think i should have everything I need in this project, but something must be missing if it isn't working.

image

@zerozinczero
Copy link

Nevermind, I got it working! I had not attached the AmazonPollyFullAccess to my unauthorized IAM

@yosun
Copy link

yosun commented Feb 17, 2020

available here

I'm using Amazon Polly with recent versions of Unity with .Net 4x Equivalent, and it's working perfectly. I'm using this DLL . Didn't need to do anything else but import inside my Unity project (of course, you will need also AWSSDK.Core, available here.

Hey, @easchimidt which version and for iOS/Android or just editor/desktop?

@DcoltGaming
Copy link

Hi @renanmgs @zerozinczero @RigosaaCL

I am having a issue where it myAccountId and authrole is null, any idea how to get round this?

AWSpollyIssue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. Unity
Projects
None yet
Development

No branches or pull requests