File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ class StreamCopyT {
54
54
size_t result = 0 ;
55
55
size_t delayCount = 0 ;
56
56
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 ;
59
59
60
60
if (len>0 ){
61
61
bytes_to_read = min (len, static_cast <size_t >(buffer_size));
Original file line number Diff line number Diff line change @@ -43,9 +43,13 @@ class SoundGenerator {
43
43
// / Provides a single sample
44
44
virtual T readSample () = 0;
45
45
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
+ }
46
50
47
51
// / 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){
49
53
LOGD (" readBytes: %d - channesl = %d" ,lengthBytes, channels);
50
54
size_t result = 0 ;
51
55
int frame_size = sizeof (T) * channels;
Original file line number Diff line number Diff line change @@ -168,6 +168,7 @@ class GeneratedSoundStream : public Stream {
168
168
169
169
// / privide the data as byte stream
170
170
size_t readBytes ( char *buffer, size_t length) {
171
+ LOGD (" GeneratedSoundStream::readBytes: %zu" , length);
171
172
return generator_ptr->readBytes ((uint8_t *)buffer, length, channels);
172
173
}
173
174
You can’t perform that action at this time.
0 commit comments