@@ -1082,7 +1082,8 @@ class InputMixer : public AudioStreamX {
1082
1082
virtual bool begin (AudioBaseInfo info) {
1083
1083
setAudioInfo (info);
1084
1084
frame_size = info.bits_per_sample /8 * info.channels ;
1085
- return true ;
1085
+ LOGI (" frame_size: %d" ,frame_size);
1086
+ return frame_size>0 ;
1086
1087
}
1087
1088
1088
1089
// / 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 {
1113
1114
1114
1115
// / Provides the data from all streams mixed together
1115
1116
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
+ }
1117
1121
LOGD (" readBytes: %d" ,(int )len);
1118
1122
// result_len must be full frames
1119
1123
int result_len = MIN (available (), len) * frame_size / frame_size;
1120
1124
int sample_count = result_len / sizeof (T);
1125
+ LOGD (" sample_count: %d" , sample_count);
1121
1126
T *p_data = (T*) data;
1122
- float sample_total = 0 ;
1127
+ float sample_total = 0 . 0f ;
1123
1128
int size_value = size ();
1129
+ LOGD (" size_value: %d" , size_value);
1124
1130
for (int j=0 ;j<sample_count; j++){
1125
1131
sample_total = 0 .0f ;
1126
1132
for (int i=0 ; i<size_value; i++){
0 commit comments