Skip to content

ku6ryo/Dify-TTS-RealTimePlay

Repository files navigation

This is an example for getting TTS audio response from Dify via API and playing it in real-time.

There are some sample files.

  • real-time_play.ts: Plays the audio response in real-time.
  • save_to_files.ts: Saves streamed audio data, response texts for each packet and concatenated text data.

The implementation details are explained in an article on dev.to

How to use

Please set your API URL and API key in .env file. Please check .env.sample file for details.

Then run to play audio in real-time:

yarn
yarn start

To save responses and audio to files:

yarn save

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published