Skip to content

Do we need a method to request voices dynamically? #45

@JayPanoz

Description

@JayPanoz

Since the WebSpeechVoiceManager instance is a singleton so that you, and the engine, can access the same, on init it parses all browser voices by default, and keep them in memory so that one can filter from the entire list of voices if needed – including novelty and low-quality, duplicates, etc.

Alternatively, you can pass an array of BCP-47 languages to limit the number of voices parsed and kept in memory.

The assumption for the latter is that you should know the list of languages before init’ing WebSpeechVoiceManager – either directly or through the WebSpeechEngine –, and that it is unlikely you will discover them after the fact, and need to extend this list.

There may be cases where this is not true, and you need to request additional voices dynamically.

Since we can only request all browser voices, we always have access to the complete list, so the method would simply re-parse with additional languages, and add to the existing array of parsed voices.

But then maybe if you can request additional voices, you may also want to remove some that are no longer needed, or that you are sure you won’t use so that they don’t waste memory… so it could be tricky to design something reasonably balanced if/once we go there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Draft

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions