SoFunction
Updated on 2025-04-10

Specific correction method for the left and right channels of android headphones


void AudioYusuStreamOut::swS2M(const void* buffer, size_t bytes)
{
uint32 Idx_i;
int16 PCM_M;
short* pbuffer=(short*)buffer;
{
//enable software stereo to mono
for(Idx_i = 0; Idx_i<bytes>>1; Idx_i+=2)
{
PCM_M = pbuffer[Idx_i+1];
pbuffer[Idx_i+1]=pbuffer[Idx_i];
pbuffer[Idx_i]=PCM_M;
}
}
}