ESPHome  2024.11.1
audio.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <stddef.h>
5 
6 namespace esphome {
7 namespace audio {
8 
10  bool operator==(const AudioStreamInfo &rhs) const {
11  return (channels == rhs.channels) && (bits_per_sample == rhs.bits_per_sample) && (sample_rate == rhs.sample_rate);
12  }
13  bool operator!=(const AudioStreamInfo &rhs) const { return !operator==(rhs); }
14  size_t get_bytes_per_sample() const { return bits_per_sample / 8; }
15  uint8_t channels = 1;
16  uint8_t bits_per_sample = 16;
17  uint32_t sample_rate = 16000;
18 };
19 
20 } // namespace audio
21 } // namespace esphome
bool operator==(const AudioStreamInfo &rhs) const
Definition: audio.h:10
bool operator!=(const AudioStreamInfo &rhs) const
Definition: audio.h:13
size_t get_bytes_per_sample() const
Definition: audio.h:14
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7