Source file: /~heha/basteln/Haus/Telefon/Sprachausgabe.zip/Minimum/AudioOutputPWM.h

#pragma once
#include "stdint.h"
#include "i2s.h"

class AudioOutputPWM{	// Singleton Adapter
public:
 AudioOutputPWM(unsigned rate=44100) {i2s_begin();SetRate(rate);}
 ~AudioOutputPWM() {i2s_end();}
 static void SetRate(unsigned hz) {i2s_set_rate(hz);}
 static void ConsumeSample(uint8_t sa) {i2s_write_sample_b(sa);}
};
Detected encoding: ASCII (7 bit)2