forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[speaker, i2s_audio] I2S Speaker implementation using a ring buffer (e…
- Loading branch information
Showing
13 changed files
with
569 additions
and
234 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import esphome.codegen as cg | ||
import esphome.config_validation as cv | ||
|
||
CODEOWNERS = ["@kahrendt"] | ||
audio_ns = cg.esphome_ns.namespace("audio") | ||
|
||
CONFIG_SCHEMA = cv.All( | ||
cv.Schema({}), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <stddef.h> | ||
|
||
namespace esphome { | ||
namespace audio { | ||
|
||
struct AudioStreamInfo { | ||
bool operator==(const AudioStreamInfo &rhs) const { | ||
return (channels == rhs.channels) && (bits_per_sample == rhs.bits_per_sample) && (sample_rate == rhs.sample_rate); | ||
} | ||
bool operator!=(const AudioStreamInfo &rhs) const { return !operator==(rhs); } | ||
size_t get_bytes_per_sample() const { return bits_per_sample / 8; } | ||
uint8_t channels = 1; | ||
uint8_t bits_per_sample = 16; | ||
uint32_t sample_rate = 16000; | ||
}; | ||
|
||
} // namespace audio | ||
} // namespace esphome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.