Skip to content

Instantly share code, notes, and snippets.

View wav_to_pcm_array.py
""" 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]
@alkhimey
alkhimey / sketch.ino
Created Aug 22, 2019
Code for playing music on ESP8266 using the PCM5102 chip
View sketch.ino
#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;