From 0acaf0462f5f7bba5e1b7c0f647bc3fb151b24b8 Mon Sep 17 00:00:00 2001 From: Mike H Date: Wed, 14 Feb 2018 15:33:19 +0000 Subject: [PATCH] Introducing wrapper function for buffer playback --- nx/include/switch/services/audout.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nx/include/switch/services/audout.h b/nx/include/switch/services/audout.h index 952f1d2f..12f4476f 100644 --- a/nx/include/switch/services/audout.h +++ b/nx/include/switch/services/audout.h @@ -23,7 +23,7 @@ typedef enum { AudioOutState_Stopped = 1, } AudioOutState; -/// audio output buffer format +/// Audio output buffer format typedef struct AudioOutBuffer AudioOutBuffer; struct AudioOutBuffer @@ -48,6 +48,16 @@ Result audoutRegisterBufferEvent(Handle *BufferEvent); Result audoutGetReleasedAudioOutBuffer(AudioOutBuffer *Buffer, u32 *ReleasedBuffersCount); Result audoutContainsAudioOutBuffer(AudioOutBuffer *Buffer, bool *ContainsBuffer); +/** + * @brief Submits an audio sample data buffer for playing. + * @param event Handle obtained from audoutRegisterBufferEvent. + * @param source AudioOutBuffer containing the source sample data to be played. + * @param released AudioOutBuffer to receive the last played buffer. + * @param duration Playback duration in ticks. + * @return Whether a timeout occurred while waiting for data to be played. + */ +bool audoutPlayBuffer(Handle *event, AudioOutBuffer *source, AudioOutBuffer *released, u64 duration); + /// These return the state associated with the currently active audio output device. u32 audoutGetSampleRate(void); u32 audoutGetChannelCount(void);