~.file
File Audio Source
FileAudioSource
FileAudioSource(
filepath: str,
duration: float | None = None,
*,
bitrate: str | None = None,
channels: int | None = None,
name: str | None = None,
volume: float | str | None = None
)
Bases: AudioSource
File audio source implementation.
Warning
This source is intended primarily for testing, development, and simple use cases. For production, URL-based or other sources are recommended. Some fields and properties cannot be reliably retrieved without excessive dependencies.
Create a file audio source.
| PARAMETER | DESCRIPTION |
|---|---|
filepath
|
The filepath to the audio file.
TYPE:
|
duration
|
If provided, the duration of this source - Required if using player timestamp properties/fields.
TYPE:
|
bitrate
|
If provided, the bitrate in which to play this source back at.
TYPE:
|
channels
|
If provided, the amount of channels this source plays with.
TYPE:
|
name
|
If provided, an internal name used for display purposes.
TYPE:
|
volume
|
If provided, overrides the player's set/default volume. Can be scaled ( |
Warning
This source is intended primarily for testing, development, and simple use cases. For production, URL-based or other sources are recommended. Some fields and properties cannot be reliably retrieved without excessive dependencies.
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
|
bitrate
property
bitrate: str | None
If provided, the bitrate in which this source is played back at.