From 563b5ba828d40c0c791e056504a53aa86ea359e1 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 7 Mar 2022 13:10:41 -0500 Subject: Implement xas_bank_entry_duration() Implement xas_bank_entry_duration() to return the number of PCM samples in a sample bank entry --- src/bank.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/bank.c b/src/bank.c index d2c7de9..698cbfb 100644 --- a/src/bank.c +++ b/src/bank.c @@ -162,6 +162,12 @@ void xas_bank_player_destroy(xas_bank_player *player) { free(player); } +size_t xas_bank_entry_duration(xas_bank *bank, size_t entry_index) { + xas_bank_entry *entry = entry_by_index(bank, entry_index); + + return entry->duration; +} + int xas_bank_player_set_entry(xas_bank_player *player, size_t entry) { if (entry > player->bank->entry_count) { errno = EINVAL; -- cgit v1.2.3