Skip to content

Commit 0eeeb72

Browse files
committed
Compile error in sound generator
1 parent b8daa45 commit 0eeeb72

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/AudioTools/SoundGenerator.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,20 @@ class SoundGenerator {
4646

4747
/// Provides the data as byte array with the requested number of channels
4848
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);
5050
size_t result = 0;
51-
int frame_size = sizeof(T) * channels;
51+
int ch = channels(;)
52+
int frame_size = sizeof(T) * ch;
5253
if (active){
53-
switch (channels()){
54+
switch (ch){
5455
case 1:
5556
result = readSamples((T*) buffer, lengthBytes / frame_size) ;
5657
break;
5758
case 2:
5859
result = readSamples((T(*)[2]) buffer, lengthBytes / frame_size);
5960
break;
6061
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);
6263
result = 0;
6364
break;
6465
}
@@ -70,7 +71,7 @@ class SoundGenerator {
7071
// when inactive did not generate anything
7172
result = 0;
7273
}
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);
7475
return result * frame_size;
7576
}
7677

@@ -89,8 +90,8 @@ class SoundGenerator {
8990
return active;
9091
}
9192

92-
void setChannels(int channels){
93-
output_channels = channels;
93+
void setChannels(int ch){
94+
output_channels = ch;
9495
}
9596

9697
int channels() {

0 commit comments

Comments
 (0)