mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 16:04:55 +00:00
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
speaker:
|
|
- platform: i2s_audio
|
|
id: speaker_source_speaker_id
|
|
i2s_audio_id: i2s_audio_bus
|
|
dac_type: external
|
|
i2s_dout_pin: ${i2s_dout_pin}
|
|
sample_rate: 48000
|
|
num_channels: 2
|
|
- platform: mixer
|
|
output_speaker: speaker_source_speaker_id
|
|
source_speakers:
|
|
- id: announcement_mixer_speaker_id
|
|
- id: media_mixer_speaker_id
|
|
|
|
audio_file:
|
|
- id: speaker_source_test_audio
|
|
file:
|
|
type: local
|
|
path: $component_dir/test.wav
|
|
|
|
media_source:
|
|
- platform: audio_file
|
|
id: announcement_audio_file_source
|
|
- platform: audio_file
|
|
id: media_audio_file_source
|
|
|
|
media_player:
|
|
- platform: speaker_source
|
|
id: media_player_id
|
|
name: Media Player
|
|
volume_increment: 0.02
|
|
volume_initial: 0.75
|
|
volume_max: 0.95
|
|
volume_min: 0.0
|
|
announcement_pipeline:
|
|
speaker: announcement_mixer_speaker_id
|
|
format: FLAC
|
|
num_channels: 1
|
|
sources:
|
|
- announcement_audio_file_source
|
|
media_pipeline:
|
|
speaker: media_mixer_speaker_id
|
|
format: FLAC
|
|
num_channels: 1
|
|
sources:
|
|
- media_audio_file_source
|
|
on_mute:
|
|
- media_player.shuffle:
|
|
id: media_player_id
|
|
on_unmute:
|
|
- media_player.unshuffle:
|
|
id: media_player_id
|
|
on_volume:
|
|
- speaker_source.set_playlist_delay:
|
|
id: media_player_id
|
|
pipeline: media
|
|
delay: 500ms
|