libnx v4.10.0
Loading...
Searching...
No Matches
Data Structures | Macros | 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...
 

Macros

#define AUDOUT_MAX_DELAY   (1000000000ULL)
 

Enumerations

enum  AudioOutState {
  AudioOutState_Started = 0 ,
  AudioOutState_Stopped = 1
}
 

Functions

Result audoutInitialize (void)
 Initialize audout.
 
void audoutExit (void)
 Exit audout.
 
Result audoutaInitialize (void)
 Initialize audout:a. Removed in [11.0.0].
 
void audoutaExit (void)
 Exit audout:a.
 
Result audoutdInitialize (void)
 Initialize audout:d. Removed in [11.0.0].
 
void audoutdExit (void)
 Exit audout:d.
 
ServiceaudoutGetServiceSession (void)
 Gets the Service object for the actual audout service session.
 
ServiceaudoutGetServiceSession_AudioOut (void)
 Gets the Service object for IAudioOut.
 
ServiceaudoutaGetServiceSession (void)
 Gets the Service for audout:a.
 
ServiceaudoutdGetServiceSession (void)
 Gets the Service for audout:d.
 
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.
 
Result audoutWaitPlayFinish (AudioOutBuffer **released, u32 *released_count, u64 timeout)
 Waits for audio playback to finish.
 
u32 audoutGetSampleRate (void)
 These return the state associated with the currently active audio output device.
 
u32 audoutGetChannelCount (void)
 Supported channel count (2 channels).
 
PcmFormat audoutGetPcmFormat (void)
 Supported PCM format (Int16).
 
AudioOutState audoutGetDeviceState (void)
 Initial device state (stopped).
 
Result audoutaRequestSuspend (u64 pid, u64 delay)
 
Result audoutaRequestResume (u64 pid, u64 delay)
 
Result audoutaGetProcessMasterVolume (u64 pid, float *volume_out)
 
Result audoutaSetProcessMasterVolume (u64 pid, u64 delay, float volume)
 
Result audoutaGetProcessRecordVolume (u64 pid, float *volume_out)
 
Result audoutaSetProcessRecordVolume (u64 pid, u64 delay, float volume)
 
Result audoutdRequestSuspendForDebug (u64 pid, u64 delay)
 
Result audoutdRequestResumeForDebug (u64 pid, u64 delay)
 

Detailed Description

Audio output service.

Author
hexkyz, TotalJustice

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.