Back to Reflex

Audio

docs/library/media/audio.md

0.9.2a2645 B
Original Source

Audio

python
import reflex as rx

The audio component can display an audio given an src path as an argument. This could either be a local path from the assets folder or an external link.

python
rx.audio(
    src="https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3",
    width="400px",
    height="32px",
)

If we had a local file in the assets folder named test.mp3 we could set src="/test.mp3" to view the audio file.

md
# How to let your user upload an audio file

To let a user upload an audio file to your app check out the [upload docs](/docs/library/forms/upload).