adhearsion / ruby_speech

A ruby library for TTS & ASR document preparation
MIT License
101 stars 41 forks source link

Prosody rate should support positive numbers #31

Closed bklang closed 8 years ago

bklang commented 10 years ago

Attempting to specify the rate as either "10%" or "+10%" gives this error:

<ArgumentError> You must specify a valid rate ([positive-number](multiplier), :"x-slow", :slow, :medium, :fast, :"x-fast", :default)

The specification allows for relative values.

benlangfeld commented 10 years ago

The specification states:

When a number is used to specify a relative change it acts as a multiplier of the default rate. For example, a value of 1 means no change in speaking rate, a value of 2 means a speaking rate twice the default rate, and a value of 0.5 means a speaking rate of half the default rate.

This is supported and is what is meant by [positive-number](multiplier). In your case, you want 1.1.

The spec also states:

Relative changes for the attributes above can be specified:

  • as a percentage (a number optionally preceded by "+" or "-" and followed by "%"), e.g. "3%", "+15.2%", "-8.0%", or
  • as a number

This percentage version is not currently supported.