Skip to content

File main.cpp

FileList > examples > WavWriter_Realtime > main.cpp

Go to the source code of this file

  • #include "daisy_seed.h"
  • #include <cmath>

Classes

Type Name
struct SimpleOsc <freq>

Public Types

Type Name
enum State

Public Attributes

Type Name
size_t duration_counter = 0
FatFSInterface fsi
DaisySeed hw
SimpleOsc< 220 > osc1
SimpleOsc< 330 > osc2
SdmmcHandler sdmmc
State state = State::Startup
WavWriter< kTransferSize > wav_writer

Public Static Attributes

Type Name
constexpr const size_t kFileDurationSamps = 96000
constexpr const uint32_t kStartupDelayMs = 2000
constexpr const float kTargetSr = 48000.f
constexpr const size_t kTransferSize = 16384

Public Functions

Type Name
void AudioCallback (AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size)
int main (void)

Public Types Documentation

enum State

enum State {
    Startup,
    Recording,
    Finalize,
    Done
};

Enum for tracking the state of our example process

We will begin in "startup" for a set duration, prior to recording. Then transition to recording, where the WAV file will be recorded from audio in the real time engine. After the duration of the recording has passed, we'll finalize the WAV file, and update to Done.


Public Attributes Documentation

variable duration_counter

size_t duration_counter;

variable fsi

FatFSInterface fsi;

variable hw

DaisySeed hw;

Global Hardware access


variable osc1

SimpleOsc<220> osc1;

variable osc2

SimpleOsc<330> osc2;

variable sdmmc

SdmmcHandler sdmmc;

variable state

State state;

variable wav_writer

WavWriter<kTransferSize> wav_writer;

Globals used for recording our WAV file


Public Static Attributes Documentation

variable kFileDurationSamps

constexpr const size_t kFileDurationSamps;

variable kStartupDelayMs

constexpr const uint32_t kStartupDelayMs;

variable kTargetSr

constexpr const float kTargetSr;

variable kTransferSize

constexpr const size_t kTransferSize;

Public Functions Documentation

function AudioCallback

void AudioCallback (
    AudioHandle::InputBuffer in,
    AudioHandle::OutputBuffer out,
    size_t size
) 

function main

int main (
    void
) 


The documentation for this class was generated from the following file external-docs/libDaisy/examples/WavWriter_Realtime/main.cpp