website/docs/services/audio/index.md
import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs'; import {ClassAll, CodeExample} from '@site/src/components/crocodocs';
Allows playing audio in Flet apps.
| Platform | Windows | macOS | Linux | iOS | Android | Web |
|---|---|---|---|---|---|---|
| Supported | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
To use Audio control add flet-audio package to your project dependencies:
requirements.txt or pyproject.toml.
</TabItem>
To install the minimal set of GStreamer libs on Ubuntu/Debian, run:
sudo apt install libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
To install the full set:
sudo apt install \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools \
gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 \
gstreamer1.0-qt5 gstreamer1.0-pulseaudio
If you receive error while loading shared libraries: libgstapp-1.0.so.0,
it means GStreamer is not installed in your WSL environment.
Install the full set of GStreamer libs, as shown above.
See this guide for installing on other Linux distributions. :::
<CodeExample path={frontMatter.examples + '/example_1/main.py'} language="python" />