Smooth audio levels by averaging over samples.

This commit is contained in:
David Zhao
2021-06-21 18:14:28 -07:00
parent 5d2fb3c09a
commit d69e9f451e
5 changed files with 87 additions and 18 deletions
+4
View File
@@ -57,6 +57,9 @@ type AudioConfig struct {
MinPercentile uint8 `yaml:"min_percentile"`
// interval to update clients, in ms
UpdateInterval uint32 `yaml:"update_interval"`
// smoothing for audioLevel values sent to the client.
// audioLevel will be an average of `smooth_samples`, 0 to disable
SmoothSamples uint32 `yaml:"smooth_samples"`
}
type RedisConfig struct {
@@ -100,6 +103,7 @@ func NewConfig(confString string) (*Config, error) {
ActiveLevel: 40,
MinPercentile: 15,
UpdateInterval: 500,
SmoothSamples: 5,
},
Redis: RedisConfig{},
TURN: TURNConfig{