Skip to content

Commit 991adef

Browse files
committed
DynamicResamplingQueueStream
1 parent d835bf6 commit 991adef

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/AudioTools/Sandbox/DynamicResamplingQueueStream.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ class DynamicResamplingQueueStream : public AudioStream {
6565
return resample_stream.readBytes(data, len);
6666
}
6767

68-
void setMovingAvgSize(int size) {
68+
/// Defines the number of historic %fill levels that will be used to calculate
69+
/// the moving avg
70+
void setMovingAvgCount(int size) {
6971
moving_average_level_percent.setSize(size);
7072
}
7173

@@ -75,6 +77,13 @@ class DynamicResamplingQueueStream : public AudioStream {
7577
resample_range = rangePercent / 100.0;
7678
}
7779

80+
/// Define the PID parameters
81+
void setPIDParameters(float p_value, float i_value, float d_value) {
82+
p = p_value;
83+
i = i_value;
84+
d = d_value;
85+
}
86+
7887
protected:
7988
PIDController pid; // p=0.005, i=0.00005, d=0.0001
8089
QueueStream<uint8_t> queue_stream;
@@ -83,8 +92,6 @@ class DynamicResamplingQueueStream : public AudioStream {
8392
ResampleStream resample_stream;
8493
float step_size = 1.0;
8594
float resample_range = 0;
86-
int copy_size = 80;
87-
int buffer_size = 0;
8895
float p = 0.005;
8996
float i = 0.00005;
9097
float d = 0.0001;

0 commit comments

Comments
 (0)