mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-20 04:26:16 +02:00
Add silence threshold for alsa stream
This commit is contained in:
parent
5d7aedeb31
commit
216714bd33
5 changed files with 61 additions and 4 deletions
|
@ -47,6 +47,9 @@ protected:
|
|||
void initAlsa();
|
||||
void uninitAlsa();
|
||||
|
||||
/// check if the chunk's volume is below the silence threshold
|
||||
bool isSilent(const msg::PcmChunk& chunk) const;
|
||||
|
||||
snd_pcm_t* handle_;
|
||||
std::unique_ptr<msg::PcmChunk> chunk_;
|
||||
bool first_;
|
||||
|
@ -61,6 +64,7 @@ protected:
|
|||
bool send_silence_;
|
||||
/// silence duration before switching the stream to idle
|
||||
std::chrono::milliseconds idle_threshold_;
|
||||
int32_t silence_threshold_ = 0;
|
||||
};
|
||||
|
||||
} // namespace streamreader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue