Skip to content
Samples for doing audio on the Particle Photon
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
audio1 fix links Aug 21, 2016
audio3 minor code edits, mostly comments Aug 22, 2016
audio4 change sample times and phase to reduce overrun errors Apr 26, 2018
LICENSE Initial commit Aug 21, 2016 add example 4 (multi ADC read) Apr 24, 2018

Photon Audio Example Code

Code examples for doing audio on the Particle Photon

Example 1 uses an [Adafruit 1713] ( Electret Microphone Amplifier - MAX9814 with Auto Gain Control to capture audio on the Photon, then sends the data via TCP to a server written in node.js. It uses a fairly straightforward method of reading the ADC using a hardware timer using the [SparkIntervalTimer] ( library.

Example 3 does the same thing, but is more experimental. It does all of the sampling in hardware using the ADC, hardware timer and DMA, storing the samples in RAM at precise intervals without using the main CPU. It's very efficient and this example works at a 32000 Hz sample rate with 16-bit samples. The node.js server program saves the data to wav files.

Example 4 is like Example 3, except it uploads 6 channels of 44.1KHz 16-bit samples to a server. The Javascript can save one of the streams to a wav file.

You can’t perform that action at this time.