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

Polly describe_voices() not working for hi-IN #3983

Closed
psambit9791 opened this issue Dec 31, 2023 · 6 comments
Closed

Polly describe_voices() not working for hi-IN #3983

psambit9791 opened this issue Dec 31, 2023 · 6 comments
Assignees
Labels
bug This issue is a confirmed bug. p3 This is a minor priority issue polly

Comments

@psambit9791
Copy link

Describe the bug

When I try to retrieve the list of voices for the language hindi, I am receiving an empty list of Voices.

Expected Behavior

There should be at least one voice - one for Neural (Kajal) and one for Standard (Standard).

Current Behavior

Returns an empty list.

Reproduction Steps

POLLY = boto3.client('polly', aws_access_key_id=ACCESS_KEY, aws_secret_access_key=SECRET_KEY, region_name=REGION)
response = SYNTHESIZE.describe_voices(
        Engine='neural',
        LanguageCode='hi-IN',
    )
print(response['Voices'])

I am operating from eu-west-2 and the role being used has full access to Polly.

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.34.11

Environment details (OS name and version, etc.)

Mac OS - Sonoma 14.2.1

@psambit9791 psambit9791 added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Dec 31, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Jan 2, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK added p3 This is a minor priority issue polly and removed needs-triage This issue or PR still needs to be triaged. labels Jan 2, 2024
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @psambit9791l, thanks for reaching out. Could you provide debug logs of this behavior? You can get debug logs by adding boto3.set_stream_logger('') to your script and redacting any sensitive information. Thanks!

@psambit9791
Copy link
Author

These are the redacted debug logs.

2024-01-04 13:26:33,276 botocore.hooks [DEBUG] Event before-parameter-build.polly.DescribeVoices: calling handler <function generate_idempotent_uuid at 0x1030ef100>
2024-01-04 13:26:33,276 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'eu-west-2', 'UseDualStack': False, 'UseFIPS': False}
2024-01-04 13:26:33,276 botocore.regions [DEBUG] Endpoint provider result: https://polly.eu-west-2.amazonaws.com
2024-01-04 13:26:33,276 botocore.hooks [DEBUG] Event before-call.polly.DescribeVoices: calling handler <function add_recursion_detection_header at 0x1030eeb60>
2024-01-04 13:26:33,276 botocore.hooks [DEBUG] Event before-call.polly.DescribeVoices: calling handler <function inject_api_version_header_if_needed at 0x103204c20>
2024-01-04 13:26:33,276 botocore.endpoint [DEBUG] Making request for OperationModel(name=DescribeVoices) with params: {'url_path': '/v1/voices', 'query_string': {'Engine': 'neural', 'LanguageCode': 'hi-IN'}, 'method': 'GET', 'headers': {'User-Agent': 'Boto3/1.34.11 md/Botocore#1.34.11 ua/2.0 os/macos#23.2.0 md/arch#arm64 lang/python#3.12.1 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.11'}, 'body': b'', 'url': 'https://polly.eu-west-2.amazonaws.com/v1/voices?Engine=neural&LanguageCode=hi-IN', 'context': {'client_region': 'eu-west-2', 'client_config': <botocore.config.Config object at 0x10400c500>, 'has_streaming_input': False, 'auth_type': None}}
2024-01-04 13:26:33,276 botocore.hooks [DEBUG] Event request-created.polly.DescribeVoices: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x10400c4a0>>
2024-01-04 13:26:33,276 botocore.hooks [DEBUG] Event choose-signer.polly.DescribeVoices: calling handler <function set_operation_specific_signer at 0x1030eefc0>
2024-01-04 13:26:33,277 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-01-04 13:26:33,277 botocore.auth [DEBUG] CanonicalRequest:
GET
/v1/voices
Engine=neural&LanguageCode=hi-IN
host:polly.eu-west-2.amazonaws.com
x-amz-date:20240104T132633Z
host;x-amz-date
xxxxxxx
2024-01-04 13:26:33,277 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240104T132633Z
20240104/eu-west-2/polly/aws4_request
xxxxxxx
2024-01-04 13:26:33,277 botocore.auth [DEBUG] Signature:
xxxxxxx
2024-01-04 13:26:33,277 botocore.hooks [DEBUG] Event request-created.polly.DescribeVoices: calling handler <function add_retry_headers at 0x1032053a0>
2024-01-04 13:26:33,277 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=GET, url=https://polly.eu-west-2.amazonaws.com/v1/voices?Engine=neural&LanguageCode=hi-IN, headers={'User-Agent': b'Boto3/1.34.11 md/Botocore#1.34.11 ua/2.0 os/macos#23.2.0 md/arch#arm64 lang/python#3.12.1 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.11', 'X-Amz-Date': b'20240104T132633Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=xxxxxxx/20240104/eu-west-2/polly/aws4_request, SignedHeaders=host;x-amz-date, Signature=xxxxxxx', 'amz-sdk-invocation-id': b'xxxxxxx', 'amz-sdk-request': b'attempt=1'}>
2024-01-04 13:26:33,277 botocore.httpsession [DEBUG] Certificate path: xxxxxxx/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-01-04 13:26:33,277 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): polly.eu-west-2.amazonaws.com:443
2024-01-04 13:26:33,461 urllib3.connectionpool [DEBUG] https://polly.eu-west-2.amazonaws.com:443 "GET /v1/voices?Engine=neural&LanguageCode=hi-IN HTTP/1.1" 200 30
2024-01-04 13:26:33,461 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': '547b5cc6-3b2c-49fd-aaa4-a782a83e332b', 'Content-Type': 'application/json', 'Content-Length': '30', 'Date': 'Thu, 04 Jan 2024 13:26:33 GMT'}
2024-01-04 13:26:33,461 botocore.parsers [DEBUG] Response body:
b'{"NextToken":null,"Voices":[]}'
2024-01-04 13:26:33,461 botocore.hooks [DEBUG] Event needs-retry.polly.DescribeVoices: calling handler <botocore.retryhandler.RetryHandler object at 0x10400d400>
2024-01-04 13:26:33,461 botocore.retryhandler [DEBUG] No retry needed.
{'ResponseMetadata': {'RequestId': '547b5cc6-3b2c-49fd-aaa4-a782a83e332b', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '547b5cc6-3b2c-49fd-aaa4-a782a83e332b', 'content-type': 'application/json', 'content-length': '30', 'date': 'Thu, 04 Jan 2024 13:26:33 GMT'}, 'RetryAttempts': 0}, 'Voices': []}

@SamRemis
Copy link
Contributor

SamRemis commented Jan 4, 2024

Hi @psambit9791,
Thank you for the debug logs :) you're getting an empty list because there are no voices at the moment that use hi-IN as their only language code. All of the voices that support hi-IN are fully bilingual and can use both hi-IN and en-IN.

You can retrieve these by using the IncludeAdditionalLanguageCodes parameter like so:

polly_client = boto3.client('polly')
response = polly_client.describe_voices(
    LanguageCode='hi-IN',
    IncludeAdditionalLanguageCodes=True,
)
print(response['Voices'])

@RyanFitzSimmonsAK RyanFitzSimmonsAK added the response-requested Waiting on additional information or feedback. label Jan 4, 2024
@SamRemis SamRemis removed the bug This issue is a confirmed bug. label Jan 4, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK added the bug This issue is a confirmed bug. label Jan 4, 2024
@psambit9791
Copy link
Author

psambit9791 commented Jan 5, 2024

Yep, the suggested solution has worked. Thanks @RyanFitzSimmonsAK and @SamRemis
But it isn't quite intuitive for me.

Is this available somewhere in the documentation that I might have missed?

@github-actions github-actions bot removed the response-requested Waiting on additional information or feedback. label Jan 6, 2024
@RyanFitzSimmonsAK
Copy link
Contributor

Technically, the description for IncludeAdditionalLanguageCodes does mention additional languages and how that parameter works. However, I do agree that the documentation is unclear and unintuitive. We've reached out to the service team about documentation improvements. In the meantime, as this is a service team issue, I've opened a tracking issue for this in our cross-SDK repository (https://github.com/aws/aws-sdk/issues/672). Please refer to the tracking issue for any updates.

Copy link

github-actions bot commented Jan 8, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. p3 This is a minor priority issue polly
Projects
None yet
Development

No branches or pull requests

3 participants