Skip to content

🚀 Feature: Cache TTS audio, enable aborting of request while loading #2100

@nihaaaar22

Description

@nihaaaar22

🔖 Feature description

Currently, whenever the tts is clicked for a message a new request is sent. This increases loading

A user cannot abort the tts request midway once requested, so once the tts request is resolved from the server, the audio starts playing irrespective that the user may be in a different conversation page.

🎤 Why is this feature needed ?

To eliminate the waiting time for successive tts requests for the same message.
To let the user cancel the request sent
The user doesn't want stale request audio to be played when the user has moved on to another page. This is necessary since the default TTS (google tts) takes a lot of time for long texts.

✌️ How do you aim to achieve this?

By caching the received audio in the audio ref.

By implementing an abort controller to abort the request midway the request.

By stopping the audio playback when the component is unmounted/ when the user moves to a different conversation.

🔄️ Additional Information

No response

👀 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

Are you willing to submit PR?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions