libnx  v4.2.0
Data Structures | Enumerations | Functions
audout.h File Reference

Audio output service. More...

#include "../types.h"
#include "../audio/audio.h"
#include "../sf/service.h"

Go to the source code of this file.

Data Structures

struct  AudioOutBuffer
 Audio output buffer format. More...
 

Enumerations

enum  AudioOutState {
  AudioOutState_Started = 0,
  AudioOutState_Stopped = 1
}
 

Functions

Result audoutInitialize (void)
 Initialize audout.
 
void audoutExit (void)
 Exit audout.
 
ServiceaudoutGetServiceSession (void)
 Gets the Service object for the actual audout service session.
 
ServiceaudoutGetServiceSession_AudioOut (void)
 Gets the Service object for IAudioOut.
 
Result audoutListAudioOuts (char *DeviceNames, s32 count, u32 *DeviceNamesCount)
 
Result audoutOpenAudioOut (const char *DeviceNameIn, char *DeviceNameOut, u32 SampleRateIn, u32 ChannelCountIn, u32 *SampleRateOut, u32 *ChannelCountOut, PcmFormat *Format, AudioOutState *State)
 
Result audoutGetAudioOutState (AudioOutState *State)
 
Result audoutStartAudioOut (void)
 
Result audoutStopAudioOut (void)
 
Result audoutAppendAudioOutBuffer (AudioOutBuffer *Buffer)
 Submits an AudioOutBuffer for playing.
 
Result audoutGetReleasedAudioOutBuffer (AudioOutBuffer **Buffer, u32 *ReleasedBuffersCount)
 
Result audoutContainsAudioOutBuffer (AudioOutBuffer *Buffer, bool *ContainsBuffer)
 
Result audoutGetAudioOutBufferCount (u32 *count)
 Only available with [4.0.0+].
 
Result audoutGetAudioOutPlayedSampleCount (u64 *count)
 Only available with [4.0.0+].
 
Result audoutFlushAudioOutBuffers (bool *flushed)
 Only available with [4.0.0+].
 
Result audoutSetAudioOutVolume (float volume)
 Only available with [6.0.0+].
 
Result audoutGetAudioOutVolume (float *volume)
 Only available with [6.0.0+].
 
Result audoutPlayBuffer (AudioOutBuffer *source, AudioOutBuffer **released)
 Submits an audio sample data buffer for playing and waits for it to finish playing. More...
 
Result audoutWaitPlayFinish (AudioOutBuffer **released, u32 *released_count, u64 timeout)
 Waits for audio playback to finish. More...
 
u32 audoutGetSampleRate (void)
 These return the state associated with the currently active audio output device. More...
 
u32 audoutGetChannelCount (void)
 Supported channel count (2 channels).
 
PcmFormat audoutGetPcmFormat (void)
 Supported PCM format (Int16).
 
AudioOutState audoutGetDeviceState (void)
 Initial device state (stopped).
 

Detailed Description

Audio output service.

Author
hexkyz

Function Documentation

◆ audoutGetSampleRate()

u32 audoutGetSampleRate ( void  )

These return the state associated with the currently active audio output device.

Supported sample rate (48000Hz).

◆ audoutPlayBuffer()

Result audoutPlayBuffer ( AudioOutBuffer source,
AudioOutBuffer **  released 
)

Submits an audio sample data buffer for playing and waits for it to finish playing.

Uses audoutAppendAudioOutBuffer and audoutWaitPlayFinish internally.

Parameters
sourceAudioOutBuffer containing the source sample data to be played.
releasedAudioOutBuffer to receive the played buffer after being released.

◆ audoutWaitPlayFinish()

Result audoutWaitPlayFinish ( AudioOutBuffer **  released,
u32 released_count,
u64  timeout 
)

Waits for audio playback to finish.

Parameters
releasedAudioOutBuffer to receive the first played buffer after being released.
released_countPointer to receive the number of played buffers.
timeoutTimeout value, use UINT64_MAX to wait until all finished.