-
Notifications
You must be signed in to change notification settings - Fork 28
/
audio_stream_conf.hh
26 lines (20 loc) · 1015 Bytes
/
audio_stream_conf.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include "util/audio_frame.hh"
struct AudioStreamConf {
// BlockSize: Number of Frames processed each time AudioStream::process() is called
static constexpr int BlockSize = 32;
// Oddly, the codec on the MP1 Disco board does not seem to work with two's-complement
// data, despite the datasheet saying it does. So we use unsigned data. TODO: Figure out why
using SampleT = uint32_t;
static constexpr int SampleRate = 48000;
static constexpr int SampleBits = 24;
static constexpr int NumInChans = 2;
static constexpr int NumOutChans = 2;
static constexpr int NumDMAHalfTransfers = 2;
using AudioInFrame = AudioFrame<SampleT, SampleBits, NumInChans>;
using AudioInBuffer = std::array<AudioInFrame, BlockSize>;
using AudioInBlock = std::array<AudioInBuffer, NumDMAHalfTransfers>;
using AudioOutFrame = AudioFrame<SampleT, SampleBits, NumOutChans>;
using AudioOutBuffer = std::array<AudioOutFrame, BlockSize>;
using AudioOutBlock = std::array<AudioOutBuffer, NumDMAHalfTransfers>;
};