Skip to content

feat: Add pause and resume methods #133

@Lechevallier

Description

@Lechevallier

Is your feature request related to a problem? Please describe:
I wish this plugin would allow to pause and resume the read.
For example, speechSynthesis allow this, but unfortunately this is not supported on android browser.

Describe the solution you'd like:
As a developer, I expect the 2 following functions to be added to the TextToSpeechPlugin interface:

export interface TextToSpeechPlugin {
    ...
    /**
     * Pause the read.
     */
    pause(): Promise<void>;
    /**
     * Resume the read.
     */
    resume(): Promise<void>;

Describe alternatives you've considered:
As said before, I tried speechSynthesis, but this is not supported for android browser.

window.speechSynthesis.start("Hello world");
window.speechSynthesis.pause();
window.speechSynthesis.resume();

Additional context:
Expected behaviour:

  • open this demo
  • click "Interrupt" to start the read
  • click the play/pause button to pause the read
  • click the play/pause button to resume the read

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions