Menu

Recording a wave file

Majenko Technologies

Record a 5 second snipped of sound, then play pack that snippet. Repeat forever.

:::C++
// The WavePro uses SPI, so you need to include the
// SPI library first.
#include <SPI.h>
#include <WavePro.h>

void setup()
{
    // Start up and configure the board
    WavePro.begin();
}

void loop()
{
    // Start recording
    WavePro.record(REC_11025 | REC_STEREO, "REC.WAV");

    // And stop after 5 seconds
    delay(5000);
    WavePro.stop();

    // Now play it
    WavePro.play("REC.WAV");
    while(WavePro.playing())
        delay(500);
}

Part of: [Examples]


Related

Wiki: Examples

MongoDB Logo MongoDB