Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.

Conversation

@DannyBen
Copy link

This PR renames the method #available_voices_in to #voices, and in addition, allows getting voices in all languages in one call.

Example usage:

synth = Pollynomial::Synthesizer.new

# Get English/US voices
p synth.voices 'en-US'

# Get all voices
p synth.voices

Closes #1

Copy link
Owner

@chezou chezou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR. I made a few comments. Could you check them?

voices = client.describe_voices(language_code: language_code)
voices.voices if voices
def voices(language=nil)
client.describe_voices(language_code: language).voices
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe if client.describe_voices(...) returns nil?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which use case do you think it returns nil? If you send an unrecognized language to AWS, an exception is raised either way. Any use case I missed?

def available_voices_in(language_code: 'en-US')
voices = client.describe_voices(language_code: language_code)
voices.voices if voices
def voices(language=nil)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is necessary to change method name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kinda is.... since it now allows all languages (i.e. accept no arguments), you end up with a broken sentence: synth.available_voices_in... in what?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants