diff options
author | XANTRONIX Development | 2022-03-14 00:41:23 -0400 |
---|---|---|
committer | XANTRONIX Development | 2022-03-14 00:41:23 -0400 |
commit | 37d07f3f657c879dc2b024ebbb981174ba6ab569 (patch) | |
tree | f47ca2d9b136f87c41d24b2a4cf86e76e4db7f0a /src | |
parent | 815ee7a10f4af1242bc0cd2d288132274615375a (diff) | |
download | xas-37d07f3f657c879dc2b024ebbb981174ba6ab569.tar.gz xas-37d07f3f657c879dc2b024ebbb981174ba6ab569.tar.bz2 xas-37d07f3f657c879dc2b024ebbb981174ba6ab569.zip |
Implement xas_drone_record_sample()
Diffstat (limited to 'src')
-rw-r--r-- | src/drone.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/drone.c b/src/drone.c index 1534e76..e7f5bfe 100644 --- a/src/drone.c +++ b/src/drone.c @@ -51,6 +51,28 @@ xas_spatial_object *xas_drone_get_spatial_object(xas_drone *drone) { return drone->obj; } +ssize_t xas_drone_record_sample(xas_drone *drone, + xas_audio_stream *source, + size_t sample_index, + size_t sample_len) { + if (sample_index >= drone->bank->entry_count + || sample_len > drone->bank->entry_size) { + errno = EINVAL; + + goto error_invalid; + } + + return xas_bank_record(drone->bank, + source, + sample_index, + sample_len); + + return 0; + +error_invalid: + return -1; +} + int xas_drone_speech_import(xas_drone *drone, const char *voice, float speed, |