Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/pollynomial/synthesizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ def synthesize(text, file_name: "tmp.mp3")
end
end

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
Copy Markdown
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
Copy Markdown
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?

client.describe_voices(language_code: language).voices
Copy link
Copy Markdown
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
Copy Markdown
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?

end

def split_text(raw_text)
Expand Down