Voss Connection Detection
1
Detect a connector click using realtime code on Bela hardware
conndetect_sndfile.h
Go to the documentation of this file.
1
#pragma once
2
#include "
config.h
"
3
#include <array>
4
#include <Bela.h>
5
#include <libraries/WriteFile/WriteFile.h>
6
/* #include <libraries/Pipe/Pipe.h> */
7
#include <array>
8
9
const
us
BUFSIZE
= 88200;
10
11
typedef
struct
SNDFILE_tag
SNDFILE
;
15
template
<us numChannels>
16
class
SndFile
{
17
18
float
_buf0[
BUFSIZE
*numChannels];
19
float
_buf1[
BUFSIZE
*numChannels];
20
us
_buf0writeptr = 0;
21
us
_buf1writeptr = 0;
22
bool
_writing =
false
;
23
24
SNDFILE
* _file;
25
AuxiliaryTask _task;
26
/* Pipe _pipe; */
27
28
template
<us>
29
friend
void
raw_sndfile_auxtask_callback
(
void
* sndfile_ptr);
30
34
void
write_task();
35
public
:
36
SndFile
(BelaContext* ctx,
const
char
* filename);
37
~SndFile
();
38
void
write
(
const
std::array<float, numChannels>& samples);
39
40
};
SNDFILE
struct SNDFILE_tag SNDFILE
Definition:
conndetect_sndfile.h:11
SndFile::SndFile
SndFile(BelaContext *ctx, const char *filename)
Definition:
conndetect_sndfile.cpp:15
SndFile::write
void write(const std::array< float, numChannels > &samples)
Definition:
conndetect_sndfile.cpp:41
SndFile
Class to write to a sound file.
Definition:
conndetect_sndfile.h:16
SndFile::~SndFile
~SndFile()
Definition:
conndetect_sndfile.cpp:97
us
unsigned int us
Used to much to not abbreviate.
Definition:
config.h:38
config.h
Configuration parameters for connection detection.
BUFSIZE
const us BUFSIZE
Definition:
conndetect_sndfile.h:9
SndFile::raw_sndfile_auxtask_callback
friend void raw_sndfile_auxtask_callback(void *sndfile_ptr)
Definition:
conndetect_sndfile.cpp:9
src
conndetect_sndfile.h
Generated by
1.8.17