summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXANTRONIX Development2022-01-31 13:17:00 -0500
committerXANTRONIX Development2022-01-31 13:17:00 -0500
commit383ef5610370db5881b102b8906dc2f55fcbf0aa (patch)
tree03fb964e9d38eb4029b8ee8a57d38f84f339c680
parent300f39e19369d44d3217bf1122d1feeaef4a0f5d (diff)
downloadxas-383ef5610370db5881b102b8906dc2f55fcbf0aa.tar.gz
xas-383ef5610370db5881b102b8906dc2f55fcbf0aa.tar.bz2
xas-383ef5610370db5881b102b8906dc2f55fcbf0aa.zip
Heh. This works.
-rw-r--r--examples/test.c6
-rw-r--r--include/xas/synth.h4
-rw-r--r--src/audio.c2
-rw-r--r--src/synth.c12
4 files changed, 5 insertions, 19 deletions
diff --git a/examples/test.c b/examples/test.c
index a56da4b..e1da192 100644
--- a/examples/test.c
+++ b/examples/test.c
@@ -60,7 +60,7 @@ int main(int argc, char **argv) {
xas_synth *synth;
synth_sine sine = {
- .flags = SYNTH_STATUS_CLEAR,
+ .flags = SYNTH_STATUS_ON,
.phase = 0.0f,
.frequency = 220
};
@@ -94,7 +94,9 @@ int main(int argc, char **argv) {
xas_synth_sample(synth)
};
- xas_synth_fill(synth, samples, 1);
+ xas_audio_stream_write(stream,
+ samples,
+ 1);
}
xas_audio_stream_flush(stream);
diff --git a/include/xas/synth.h b/include/xas/synth.h
index 014d330..fe3ce9f 100644
--- a/include/xas/synth.h
+++ b/include/xas/synth.h
@@ -29,8 +29,4 @@ void xas_synth_destroy(xas_synth *synth);
int16_t xas_synth_sample(xas_synth *synth);
-ssize_t xas_synth_fill(xas_synth *synth,
- int16_t *samples,
- size_t count);
-
#endif /* _XAS_SYNTH_H */
diff --git a/src/audio.c b/src/audio.c
index 5902589..85f417d 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -55,7 +55,7 @@ xas_audio_stream *xas_audio_stream_new_sink(xas_audio_drain drain,
}
xas_audio_stream *xas_audio_stream_new_source(xas_audio_fill fill,
- xas_audio_cleanup cleanup,
+ xas_audio_cleanup cleanup,
void *ctx,
size_t sample_size,
size_t sample_rate,
diff --git a/src/synth.c b/src/synth.c
index 96c6d83..9b18daf 100644
--- a/src/synth.c
+++ b/src/synth.c
@@ -32,15 +32,3 @@ void xas_synth_destroy(xas_synth *synth) {
int16_t xas_synth_sample(xas_synth *synth) {
return synth->sample(synth, synth->ctx);
}
-
-ssize_t xas_synth_fill(xas_synth *synth,
- int16_t *samples,
- size_t count) {
- size_t i;
-
- for (i=0; i<count; i++) {
- samples[i] = synth->sample(synth, synth->ctx);
- }
-
- return count;
-}