Speech-dispatcher handling improved.
This commit is contained in:
1 parent
60abcc37d9
commit
ec32c6e4c4
11 files changed
+638
-222
No files matched your search
@@ -40,11 +40,8 @@ func Validate_selection(module, language, voice string) error {
|
||||
// deadline and the entire catalog has a four-second budget. Partial failures
|
||||
// retain successful modules and mark unavailable voice lists explicitly.
|
||||
func Discover(options Options) (Catalog, error) {
|
||||
if options.Socket == "" {
|
||||
options.Socket = Default_socket()
|
||||
}
|
||||
result := Catalog{Voices: map[string][]Voice{}, Errors: map[string]error{}}
|
||||
w, err := connect(options.Socket)
|
||||
w, err := connect_options(options)
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
@@ -195,6 +192,7 @@ func Prepare(driver string, options Options) (Transport, error) {
|
||||
if err = d.Availability(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
options.autospawn = driver == "speech-dispatcher"
|
||||
if options.Module != "" {
|
||||
modules, err := d.Modules(options)
|
||||
if err != nil {
|
||||
@@ -230,10 +228,7 @@ func discover_voices(options Options) ([]Voice, error) {
|
||||
if err := Validate_selection(options.Module, options.Language, options.Voice); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if options.Socket == "" {
|
||||
options.Socket = Default_socket()
|
||||
}
|
||||
w, err := connect(options.Socket)
|
||||
w, err := connect_options(options)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user