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

Audio output service. More...

#include "../audio/audio.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)
 
void audoutExit (void)
 
Result audoutListAudioOuts (char *DeviceNames, 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)
 
Result audoutGetReleasedAudioOutBuffer (AudioOutBuffer **Buffer, u32 *ReleasedBuffersCount)
 
Result audoutContainsAudioOutBuffer (AudioOutBuffer *Buffer, bool *ContainsBuffer)
 
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

u32 audoutGetSampleRate ( void  )

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

Supported sample rate (48000Hz).

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.
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 U64_MAX to wait until all finished.