reactor-c
1.0
C Runtime for Lingua Franca
Toggle main menu visibility
Loading...
Searching...
No Matches
audio_loop.h
Go to the documentation of this file.
1
37
38
#ifndef AUDIO_LOOP_H
39
#define AUDIO_LOOP_H
40
41
#include "
wave_file_reader.h
"
// Defines lf_waveform_t.
42
#include "
tag.h
"
// Defines instant_t.
43
44
#ifndef SAMPLE_RATE
49
#define SAMPLE_RATE 44100
50
#endif
51
52
#ifndef AUDIO_BUFFER_SIZE
57
#define AUDIO_BUFFER_SIZE 4410
// 1/10 second, 100 msec
58
#endif
59
60
#ifndef BUFFER_DURATION_NS
65
#define BUFFER_DURATION_NS 100000000LL
66
#endif
67
68
#ifndef NUM_CHANNELS
73
#define NUM_CHANNELS 1
// 2 for stereo
74
#endif
75
76
#ifndef MAX_AMPLITUDE
81
#define MAX_AMPLITUDE 32765
82
#endif
83
84
#ifndef NUM_NOTES
89
#define NUM_NOTES 8
// Maximum number of notes that can play simultaneously.
90
#endif
91
101
void
lf_start_audio_loop
(
instant_t
start_time
);
102
107
void
lf_stop_audio_loop
();
108
125
int
lf_play_audio_waveform
(
lf_waveform_t
* waveform,
float
emphasis,
instant_t
start_time
);
126
136
void
add_to_sound
(
int
index_offset,
double
value);
137
138
#endif
// AUDIO_LOOP_H
instant_t
int64_t instant_t
Time instant.
Definition
tag.h:101
lf_play_audio_waveform
int lf_play_audio_waveform(lf_waveform_t *waveform, float emphasis, instant_t start_time)
Play the specified waveform with the specified emphasis at the specified time.
lf_stop_audio_loop
void lf_stop_audio_loop()
Stop the audio loop thread.
lf_start_audio_loop
void lf_start_audio_loop(instant_t start_time)
Start an audio loop thread that becomes ready to receive audio amplitude samples via add_to_sound().
add_to_sound
void add_to_sound(int index_offset, double value)
Add the given value to the current write buffer at the specified index.
lf_waveform_t
Waveform in 16-bit linear-PCM format.
Definition
wave_file_reader.h:50
tag.h
Time and tag definitions and functions for Lingua Franca.
start_time
instant_t start_time
wave_file_reader.h
Utility function for reading WAV audio files.
Users
runner
work
reactor-c
reactor-c
util
audio_loop.h
Generated on
for reactor-c by
1.17.0