Skip to content

Commit 30c9991

Browse files
committed
postProcessSmoothTransition
1 parent ec6e5fe commit 30c9991

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/examples-audiokit/streams-audiokit-ram-audiokit/streams-audiokit-ram-audiokit.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void record_end(bool pinStatus, int pin, void* ref){
3333
// Remove popping noise, from button: we delete 6 segments at the beginning and end
3434
// and on the resulting audio we slowly raise the volume on the first segment
3535
// end decrease it on the last segment
36-
recording.postProcessSmoothTransition<int16_t>(channels, 6, 0.01);
36+
recording.postProcessSmoothTransition<int16_t>(channels, 0.01, 6);
3737

3838
copier.begin(kit, recording); // start playback
3939
}

src/AudioTools/AudioStreams.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class DynamicMemoryStream : public AudioStreamX {
338338
};
339339

340340
DynamicMemoryStream() = default;
341-
341+
342342
DynamicMemoryStream(bool isLoop, int defaultBufferSize=DEFAULT_BUFFER_SIZE ) {
343343
this->default_buffer_size = defaultBufferSize;
344344
is_loop = isLoop;
@@ -465,7 +465,7 @@ class DynamicMemoryStream : public AudioStreamX {
465465
/// @tparam T
466466
/// @param factor
467467
template<typename T>
468-
void postProcessSmoothTransition(int channels, int remove, float factor = 0.01){
468+
void postProcessSmoothTransition(int channels, float factor = 0.01, int remove=0){
469469
if (remove>0){
470470
for (int j=0;j<remove;j++){
471471
DataNode* node = nullptr;

0 commit comments

Comments
 (0)