@@ -46,19 +46,20 @@ class SoundGenerator {
46
46
47
47
// / Provides the data as byte array with the requested number of channels
48
48
virtual size_t readBytes ( uint8_t *buffer, size_t lengthBytes){
49
- LOGD (" readBytes: %d - channesl = %d" ,lengthBytes, channels );
49
+ LOGD (" readBytes: %d - channesl = %d" ,lengthBytes);
50
50
size_t result = 0 ;
51
- int frame_size = sizeof (T) * channels;
51
+ int ch = channels (;)
52
+ int frame_size = sizeof (T) * ch;
52
53
if (active){
53
- switch (channels () ){
54
+ switch (ch ){
54
55
case 1 :
55
56
result = readSamples ((T*) buffer, lengthBytes / frame_size) ;
56
57
break ;
57
58
case 2 :
58
59
result = readSamples ((T (*)[2 ]) buffer, lengthBytes / frame_size);
59
60
break ;
60
61
default :
61
- LOGE ( " SoundGenerator::readBytes -> number of channels %d is not supported (use 1 or 2)" , channels );
62
+ LOGE ( " SoundGenerator::readBytes -> number of channels %d is not supported (use 1 or 2)" , ch );
62
63
result = 0 ;
63
64
break ;
64
65
}
@@ -70,7 +71,7 @@ class SoundGenerator {
70
71
// when inactive did not generate anything
71
72
result = 0 ;
72
73
}
73
- LOGD ( " SoundGenerator::readBytes (channels: %d) %zu bytes -> %zu samples" , channels , lengthBytes, result);
74
+ LOGD ( " SoundGenerator::readBytes (channels: %d) %zu bytes -> %zu samples" , ch , lengthBytes, result);
74
75
return result * frame_size;
75
76
}
76
77
@@ -89,8 +90,8 @@ class SoundGenerator {
89
90
return active;
90
91
}
91
92
92
- void setChannels (int channels ){
93
- output_channels = channels ;
93
+ void setChannels (int ch ){
94
+ output_channels = ch ;
94
95
}
95
96
96
97
int channels () {
0 commit comments