Audio Tool issue (TTS)
Self Checks
- [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
- [x] Please do not modify this template :) and fill in all the required fields.
Dify version
1.2.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
- Create an agent and add audio tool text to speech ( hjlarry/audio ) - Convert text to audio file.
- ask to make an English text like " hello there" to TTS
the tool seems like generates the audio TTS file but cannot return it to download although I already did setup FILES_URL=my-own-domain.com variable within .env but did not solved the issue
✔️ Expected Behavior
Get generated audio file in .wav format to download
❌ Actual Behavior
the tool call shows:
1' Used tts REQUEST {"tts": {"text": "hi there"}} RESPONSE {"tts": "Audio generated successfullytext='/files/tools/e75da19d- b933-4ce2-879e-24baad5866ea.wav""}
The text-to-speech audio for "hi there" has been generated. You can listen to it here.
- When you click on the link as the link shows it just refresh the app as the link does not point to any audio file
The issue you're experiencing with the text-to-speech (TTS) tool not returning the generated audio file for download, despite setting the FILES_URL variable correctly, might be due to the absence of FFmpeg installation. FFmpeg is required for normal use of OpenAI TTS because it implements audio stream segmentation. Ensure that FFmpeg is installed on your system.
Here are the installation steps for different operating systems:
- Windows: Download the precompiled shared libraries from the FFmpeg official website, extract them, and add the bin directory to your system's environment variables.
- Ubuntu: Use
sudo apt-get install ffmpeg. - CentOS: Enable the EPEL repository and use
sudo yum install ffmpeg ffmpeg-devel. - Mac OS X: Use Homebrew with
brew install ffmpeg.
After installation, check the setup by running ffmpeg -version to confirm successful installation [1][2].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
I have installed ffmpeg in my ubuntu 22.04 vps:
root@VM-bucket:~# ffmpeg -version ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11 (Ubuntu 11.2.0-19ubuntu1) configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100
but issue is the same
The issue you're experiencing with the text-to-speech (TTS) tool not returning the generated audio file for download, despite setting the
FILES_URLvariable correctly, might be due to the absence of FFmpeg installation. FFmpeg is required for normal use of OpenAI TTS because it implements audio stream segmentation. Ensure that FFmpeg is installed on your system.Here are the installation steps for different operating systems:
- Windows: Download the precompiled shared libraries from the FFmpeg official website, extract them, and add the bin directory to your system's environment variables.
- Ubuntu: Use
sudo apt-get install ffmpeg.- CentOS: Enable the EPEL repository and use
sudo yum install ffmpeg ffmpeg-devel.- Mac OS X: Use Homebrew with
brew install ffmpeg.After installation, check the setup by running
ffmpeg -versionto confirm successful installation [1][2].To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
See the original output of the LLM You can listen to it [here](https://ssd.xxx.ir/app/83da8946-4991-44a3-a79e-883ee491d128/configuration).
The link in the output is wrong, it should be formatted into https://ssd.xxx.ir/files/tools/e75da19d- b933-4ce2-879e-24baad5866ea.wav"
Please see the working example below.