Skip to content

Instantly share code, notes, and snippets.

@alkhimey
alkhimey / sketch.ino
Created August 22, 2019 19:07
Code for playing music on ESP8266 using the PCM5102 chip
#include "ESP8266WiFi.h"
#include "i2s.h"
#include "i2s_reg.h"
#define RATE 44100
#define SINE_SAMPLES 512
const int c = 261;
const int d = 294;
const int e = 329;
""" Assumes the input WAV file is mono (1 channel) with 16 bit samples """
import sys
if len(sys.argv) != 2:
print("Wrong number of arguments.")
exit();
filename = sys.argv[1]