Support command line text & new API attributes (#8)

* support `style` and `use_speaker_boost` API attrs

* support optional command line string as text

* print out time it took to run
This commit is contained in:
samy kamkar
2024-07-24 12:14:00 -07:00
committed by GitHub
parent 41f142ec2c
commit c585531fae
3 changed files with 25 additions and 5 deletions

View File

@@ -31,11 +31,19 @@ func (so *SynthesisOptions) Clamp() {
if so.SimilarityBoost > 1 || so.SimilarityBoost < 0 {
so.SimilarityBoost = 0.75
}
if so.Style > 1 || so.Style < 0 {
so.Style = 0.0
}
if so.UseSpeakerBoost != true && so.UseSpeakerBoost != false {
so.UseSpeakerBoost = true
}
}
type SynthesisOptions struct {
Stability float64 `json:"stability"`
SimilarityBoost float64 `json:"similarity_boost"`
Style float64 `json:"style"`
UseSpeakerBoost bool `json:"use_speaker_boost"`
}
type SharingOptions struct {