ESPHome
2024.12.2
esphome
esphome
components
audio
audio.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstddef>
4
#include <cstdint>
5
6
namespace
esphome
{
7
namespace
audio {
8
9
struct
AudioStreamInfo
{
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
esphome::audio::AudioStreamInfo::sample_rate
uint32_t sample_rate
Definition:
audio.h:17
esphome::audio::AudioStreamInfo::bits_per_sample
uint8_t bits_per_sample
Definition:
audio.h:16
esphome::audio::AudioStreamInfo::channels
uint8_t channels
Definition:
audio.h:15
esphome::audio::AudioStreamInfo::operator==
bool operator==(const AudioStreamInfo &rhs) const
Definition:
audio.h:10
esphome::audio::AudioStreamInfo
Definition:
audio.h:9
esphome::audio::AudioStreamInfo::operator!=
bool operator!=(const AudioStreamInfo &rhs) const
Definition:
audio.h:13
esphome::audio::AudioStreamInfo::get_bytes_per_sample
size_t get_bytes_per_sample() const
Definition:
audio.h:14
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
Generated by
1.8.13