Commit cf88468f authored by schreibfaul1's avatar schreibfaul1

little improvements

parent dd1afff7
......@@ -296,6 +296,7 @@ esp_err_t Audio::I2Sstop(uint8_t i2s_num) {
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void Audio::setDefaults() {
stopSong();
setSampleRate(16000); // ESP32-S3 -> reduce SR, if 48000Hz a connect to another URL is impossible
initInBuff(); // initialize InputBuffer if not already done
InBuff.resetBuffer();
MP3Decoder_FreeBuffers();
......
......@@ -19,7 +19,7 @@ bool s_f_opusFramePacket = false;
bool s_f_opusStereoFlag = false;
uint8_t s_opusChannels = 0;
uint8_t s_opusCountCode = 0;
uint16_t s_opusSamplerate = 0;
uint32_t s_opusSamplerate = 0;
uint32_t s_opusSegmentLength = 0;
uint32_t s_opusBlockPicLen = 0;
uint32_t s_opusBlockPicPos = 0;
......@@ -365,7 +365,7 @@ int parseOpusHead(uint8_t *inbuf, int nBytes){ // reference https://wiki.xiph.o
outputGain += *(inbuf + 16);
uint8_t channelMap = *(inbuf + 18);
if(channelCount == 0 or channelCount >2) return ERR_OPUS_CHANNELS_OUT_OF_RANGE;
if(channelCount == 0 || channelCount >2) return ERR_OPUS_CHANNELS_OUT_OF_RANGE;
s_opusChannels = channelCount;
if(sampleRate != 48000) return ERR_OPUS_INVALID_SAMPLERATE;
s_opusSamplerate = sampleRate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment