diff --git a/nx/include/switch/services/audout.h b/nx/include/switch/services/audout.h index 1f8a20a5..d9e7a62f 100644 --- a/nx/include/switch/services/audout.h +++ b/nx/include/switch/services/audout.h @@ -29,7 +29,7 @@ typedef struct AudioOutBuffer AudioOutBuffer; struct AudioOutBuffer { AudioOutBuffer* next; ///< Next buffer. - void* buffer; ///< Sample buffer. + void* buffer; ///< Sample buffer (aligned to 0x1000 bytes). u64 buffer_size; ///< Sample buffer size. u64 data_size; ///< Size of data inside the buffer. u64 data_offset; ///< Offset of data inside the buffer. @@ -52,7 +52,7 @@ Result audoutContainsAudioOutBuffer(AudioOutBuffer *Buffer, bool *ContainsBuffer * @param source AudioOutBuffer containing the source sample data to be played. * @param released AudioOutBuffer to receive the last played buffer. */ -void audoutPlayBuffer(AudioOutBuffer *source, AudioOutBuffer *released); +Result audoutPlayBuffer(AudioOutBuffer *source, AudioOutBuffer *released); /// These return the state associated with the currently active audio output device. u32 audoutGetSampleRate(void); ///< Supported sample rate (48000Hz). diff --git a/nx/source/services/audout.c b/nx/source/services/audout.c index 9ca8d613..6c2a6096 100644 --- a/nx/source/services/audout.c +++ b/nx/source/services/audout.c @@ -82,7 +82,7 @@ AudioOutState audoutGetDeviceState(void) { return g_deviceState; } -void audoutPlayBuffer(AudioOutBuffer *source, AudioOutBuffer *released) { +Result audoutPlayBuffer(AudioOutBuffer *source, AudioOutBuffer *released) { // Try to push the supplied buffer to the audio output device Result do_append = audoutAppendAudioOutBuffer(source); @@ -103,6 +103,8 @@ void audoutPlayBuffer(AudioOutBuffer *source, AudioOutBuffer *released) { do_release = audoutGetReleasedAudioOutBuffer(released, &released_count); } } + + return do_append; } Result audoutListAudioOuts(char *DeviceNames, u32 *DeviceNamesCount) {