Skip to content

Commit 49cdf94

Browse files
committed
fix broken Sine generator
1 parent a4b93d9 commit 49cdf94

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/AudioTools/AudioCopy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class StreamCopyT {
5454
size_t result = 0;
5555
size_t delayCount = 0;
5656
size_t len = available();
57-
size_t bytes_to_read;
58-
size_t bytes_read;
57+
size_t bytes_to_read=0;
58+
size_t bytes_read=0;
5959

6060
if (len>0){
6161
bytes_to_read = min(len, static_cast<size_t>(buffer_size));

src/AudioTools/SoundGenerator.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ class SoundGenerator {
4343
/// Provides a single sample
4444
virtual T readSample() = 0;
4545

46+
/// Provides the data as byte array with the requested number of channels
47+
virtual size_t readBytes( uint8_t *buffer, size_t lengthBytes){
48+
return readBytes(buffer, lengthBytes);
49+
}
4650

4751
/// Provides the data as byte array with the requested number of channels
48-
virtual size_t readBytes( uint8_t *buffer, size_t lengthBytes, uint8_t channels=1){
52+
virtual size_t readBytes( uint8_t *buffer, size_t lengthBytes, uint8_t channels){
4953
LOGD("readBytes: %d - channesl = %d",lengthBytes, channels);
5054
size_t result = 0;
5155
int frame_size = sizeof(T) * channels;

src/AudioTools/Streams.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ class GeneratedSoundStream : public Stream {
168168

169169
/// privide the data as byte stream
170170
size_t readBytes( char *buffer, size_t length) {
171+
LOGD("GeneratedSoundStream::readBytes: %zu", length);
171172
return generator_ptr->readBytes((uint8_t*)buffer, length, channels);
172173
}
173174

0 commit comments

Comments
 (0)