Skip to content

Commit b4a2f64

Browse files
committed
InputMixer more debug lines
1 parent 7a4631e commit b4a2f64

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/AudioTools/AudioStreams.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,8 @@ class InputMixer : public AudioStreamX {
10821082
virtual bool begin(AudioBaseInfo info) {
10831083
setAudioInfo(info);
10841084
frame_size = info.bits_per_sample/8 * info.channels;
1085-
return true;
1085+
LOGI("frame_size: %d",frame_size);
1086+
return frame_size>0;
10861087
}
10871088

10881089
/// Defines a new weight for the indicated channel: If you set it to 0 it is muted.
@@ -1113,14 +1114,19 @@ class InputMixer : public AudioStreamX {
11131114

11141115
/// Provides the data from all streams mixed together
11151116
size_t readBytes(uint8_t* data, size_t len) override {
1116-
if (total_weights==0 || frame_size==0 || len==0) return 0;
1117+
if (total_weights==0 || frame_size==0 || len==0) {
1118+
LOGW("readBytes: %d",(int)len);
1119+
return 0;
1120+
}
11171121
LOGD("readBytes: %d",(int)len);
11181122
// result_len must be full frames
11191123
int result_len = MIN(available(), len) * frame_size / frame_size;
11201124
int sample_count = result_len / sizeof(T);
1125+
LOGD("sample_count: %d", sample_count);
11211126
T *p_data = (T*) data;
1122-
float sample_total = 0;
1127+
float sample_total = 0.0f;
11231128
int size_value = size();
1129+
LOGD("size_value: %d", size_value);
11241130
for (int j=0;j<sample_count; j++){
11251131
sample_total = 0.0f;
11261132
for (int i=0; i<size_value; i++){

0 commit comments

Comments
 (0)