chezou / pollynomial

AWS Polly wrapper for Ruby: Text to speech gem
MIT License
6 stars 4 forks source link

Allow use of SSML #2

Open DannyBen opened 7 years ago

DannyBen commented 7 years ago

Hi again.

I noticed that the #synthesize method does not allow passing additional parameters, so as I understand it, there is no way to pass SSML to this method.

I was thinking, maybe provide one or both of these options:

  1. If the text argument is detected as SSML (e.g., if it starts with <speak>), then automatically set text_type: 'ssml' when calling #synthesize_speech
  2. Instead of (or better, in addition to) the above, maybe add optional opts={} argument to the method, and merge these options when calling #synthesize_speech

Thoughts?

Would you accept a pull request for this, and maybe for #1 as well?

chezou commented 7 years ago

Once I considered to support SSML, but it should be refactored to be supported it. It is pretty hard to tokenize SSML text appropriately.

I will recommend using ssml2mp3.