Merge 0745e168d1
into b3c41668a2
This commit is contained in:
commit
371e8f041b
|
@ -22,7 +22,7 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "AudioOutputPWM.h"
|
#include "AudioOutputPWM.h"
|
||||||
|
|
||||||
AudioOutputPWM::AudioOutputPWM(long sampleRate, pin_size_t data) {
|
AudioOutputPWM::AudioOutputPWM(long sampleRate, pin_size_t data) : pwm(data, false) {
|
||||||
pwmOn = false;
|
pwmOn = false;
|
||||||
mono = false;
|
mono = false;
|
||||||
bps = 16;
|
bps = 16;
|
||||||
|
@ -89,7 +89,10 @@ bool AudioOutputPWM::ConsumeSample(int16_t sample[2]) {
|
||||||
ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff;
|
ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pwm.available()) {
|
ms[LEFTCHANNEL] = Amplify(ms[LEFTCHANNEL]);
|
||||||
|
ms[RIGHTCHANNEL] = Amplify(ms[RIGHTCHANNEL]);
|
||||||
|
|
||||||
|
if (pwm.available()) {
|
||||||
pwm.write((int16_t) ms[0]);
|
pwm.write((int16_t) ms[0]);
|
||||||
pwm.write((int16_t) ms[1]);
|
pwm.write((int16_t) ms[1]);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue