mirror of https://github.com/arendst/Tasmota.git
fix i2s audio
This commit is contained in:
parent
62c95122f2
commit
12954aea68
|
@ -197,8 +197,8 @@ bool AudioOutputI2S::ConsumeSample(int16_t sample[2])
|
|||
// Deprecated. Use i2s_write
|
||||
// return i2s_write_bytes((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), 0);
|
||||
size_t bytes_written;
|
||||
return (ESP_OK == i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0));
|
||||
// return bytes_written;
|
||||
i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0);
|
||||
return bytes_written;
|
||||
#else
|
||||
uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL]))<<16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff);
|
||||
return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true
|
||||
|
@ -225,5 +225,3 @@ bool AudioOutputI2S::stop()
|
|||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2])
|
|||
// Deprecated. Use i2s_write
|
||||
// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0))
|
||||
size_t bytes_written;
|
||||
if (ESP_OK != i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0))
|
||||
if (!i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0))
|
||||
return false;
|
||||
#else
|
||||
if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn
|
||||
|
|
Loading…
Reference in New Issue