@@ -56,7 +56,7 @@ class VS1053BaseStream : public AudioStreamX {
56
56
57
57
// / value from 0 to 1.0
58
58
void setVolume (float vol){
59
- LOGD (LOG_METHOD );
59
+ LOGD (" setVolume: %f " , vol );
60
60
// make sure that value is between 0 and 1
61
61
float volume = vol;
62
62
if (volume>1.0 ) volume = 1.0 ;
@@ -76,7 +76,7 @@ class VS1053BaseStream : public AudioStreamX {
76
76
77
77
// / Adjusting the left and right volume balance, higher to enhance the right side, lower to enhance the left side.
78
78
void setBalance (float bal){
79
- LOGD (LOG_METHOD );
79
+ LOGD (" setBalance: %f " , vol );
80
80
float balance = bal;
81
81
if (balance<-1.0 ) balance = -1 ;
82
82
if (balance>1.0 ) balance = 1 ;
@@ -115,7 +115,7 @@ class VS1053BaseStream : public AudioStreamX {
115
115
116
116
// / Sets the treble amplitude value (range 0 to 1.0)
117
117
void setTreble (float val){
118
- LOGD (LOG_METHOD );
118
+ LOGD (" setTreble: %f " , vol );
119
119
float value = val;
120
120
if (value<0.0 ) value = 0.0 ;
121
121
if (value>1.0 ) value = 1.0 ;
@@ -133,22 +133,22 @@ class VS1053BaseStream : public AudioStreamX {
133
133
134
134
// / Sets the bass amplitude value (range 0 to 1.0)
135
135
void setBass (float value){
136
- LOGD (LOG_METHOD );
136
+ LOGD (" setBass: %f " , vol );
137
137
if (p_vs1053!=nullptr ){
138
138
p_vs1053->setBass (value*100.0 );
139
139
}
140
140
}
141
141
142
142
// / Sets the treble frequency limit in hz (range 0 to 15000)
143
143
void setTrebleFrequencyLimit (uint16_t value){
144
- LOGD (LOG_METHOD );
144
+ LOGD (" setTrebleFrequencyLimit: %u " , vol );
145
145
if (p_vs1053!=nullptr ){
146
146
p_vs1053->setTrebleFrequencyLimit (value);
147
147
}
148
148
}
149
149
// / Sets the bass frequency limit in hz (range 0 to 15000)
150
150
void setBassFrequencyLimit (uint16_t value){
151
- LOGD (LOG_METHOD );
151
+ LOGD (" setBassFrequencyLimit: %u " , vol );
152
152
if (p_vs1053!=nullptr ){
153
153
p_vs1053->setBassFrequencyLimit (value);
154
154
}
@@ -212,6 +212,7 @@ class VS1053Stream : public AudioStreamX {
212
212
// / Starts with the indicated configuration
213
213
bool begin (VS1053Config cfg) {
214
214
LOGI (LOG_METHOD);
215
+ bool result = true ;
215
216
// enfornce encoded data for midi mode
216
217
if (cfg.is_midi_mode ){
217
218
cfg.is_encoded_data = true ;
@@ -245,20 +246,27 @@ class VS1053Stream : public AudioStreamX {
245
246
case TX_MODE:
246
247
p_out->begin (cfg);
247
248
p_driver->begin ();
248
- return true ;
249
+ setVolume (VS1053_DEFAULT_VOLUME);
250
+ result = true ;
251
+ break ;
249
252
#if VS1053_EXT
250
253
case MIDI_MODE:
251
254
getVS1053 ().beginMIDI ();
252
- return true ;
255
+ setVolume (VS1053_DEFAULT_VOLUME);
256
+ result = true ;
257
+ break ;
253
258
254
259
case RX_MODE:
255
260
getVS1053 ().beginInput (cfg.is_encoded_data );
256
- return true ;
261
+ result = true ;
262
+ break ;
257
263
#endif
258
264
default :
259
265
LOGE (" Mode not supported" );
260
- return false ;
266
+ result = false ;
267
+ break ;
261
268
}
269
+ return result;
262
270
}
263
271
264
272
// / Stops the processing and releases the memory
0 commit comments