Commit cbaefeca authored by tueddy's avatar tueddy

event audio_process_i2s for processing audio data extern after applying filters and gain.

Needed for sending audio through A2DP-source
parent 90fd4412
......@@ -4371,6 +4371,15 @@ bool Audio::playSample(int16_t sample[2]) {
uint32_t s32 = Gain(sample); // vosample2lume;
if(audio_process_i2s){
// process audio sample just before writing to i2s
bool continueI2S = false;
audio_process_i2s(&s32, &continueI2S);
if(!continueI2S){
return true;
}
}
if(m_f_internalDAC) {
s32 += 0x80008000;
}
......
......@@ -82,6 +82,7 @@ extern __attribute__((weak)) void audio_lasthost(const char*);
extern __attribute__((weak)) void audio_eof_speech(const char*);
extern __attribute__((weak)) void audio_eof_stream(const char*); // The webstream comes to an end
extern __attribute__((weak)) void audio_process_extern(int16_t* buff, uint16_t len, bool *continueI2S); // record audiodata or send via BT
extern __attribute__((weak)) void audio_process_i2s(uint32_t* sample, bool *continueI2S); // record audiodata or send via BT
#define AUDIO_INFO(...) {char buff[512 + 64]; sprintf(buff,__VA_ARGS__); if(audio_info) audio_info(buff);}
......
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