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

Audio input service. More...

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

Go to the source code of this file.

Data Structures

struct  AudioInBuffer
 Audio input buffer format. More...
 

Enumerations

enum  AudioInState {
  AudioInState_Started = 0,
  AudioInState_Stopped = 1
}
 

Functions

Result audinInitialize (void)
 Initialize audin.
 
void audinExit (void)
 Exit audin.
 
ServiceaudinGetServiceSession (void)
 Gets the Service object for the actual audin service session.
 
ServiceaudinGetServiceSession_AudioIn (void)
 Gets the Service object for IAudioIn.
 
Result audinListAudioIns (char *DeviceNames, s32 count, u32 *DeviceNamesCount)
 
Result audinOpenAudioIn (const char *DeviceNameIn, char *DeviceNameOut, u32 SampleRateIn, u32 ChannelCountIn, u32 *SampleRateOut, u32 *ChannelCountOut, PcmFormat *Format, AudioInState *State)
 
Result audinGetAudioInState (AudioInState *State)
 
Result audinStartAudioIn (void)
 
Result audinStopAudioIn (void)
 
Result audinAppendAudioInBuffer (AudioInBuffer *Buffer)
 Submits an AudioInBuffer for capturing.
 
Result audinGetReleasedAudioInBuffer (AudioInBuffer **Buffer, u32 *ReleasedBuffersCount)
 
Result audinContainsAudioInBuffer (AudioInBuffer *Buffer, bool *ContainsBuffer)
 
Result audinCaptureBuffer (AudioInBuffer *source, AudioInBuffer **released)
 Submits an audio sample data buffer for capturing and waits for it to finish capturing. More...
 
Result audinWaitCaptureFinish (AudioInBuffer **released, u32 *released_count, u64 timeout)
 Waits for audio capture to finish. More...
 
u32 audinGetSampleRate (void)
 These return the state associated with the currently active audio input device. More...
 
u32 audinGetChannelCount (void)
 Supported channel count (2 channels).
 
PcmFormat audinGetPcmFormat (void)
 Supported PCM format (Int16).
 
AudioInState audinGetDeviceState (void)
 Initial device state (stopped).
 

Detailed Description

Audio input service.

Author
hexkyz

Function Documentation

◆ audinCaptureBuffer()

Result audinCaptureBuffer ( AudioInBuffer source,
AudioInBuffer **  released 
)

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

Uses audinAppendAudioInBuffer and audinWaitCaptureFinish internally.

Parameters
sourceAudioInBuffer containing the buffer to hold the captured sample data.
releasedAudioInBuffer to receive the captured buffer after being released.

◆ audinGetSampleRate()

u32 audinGetSampleRate ( void  )

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

Supported sample rate (48000Hz).

◆ audinWaitCaptureFinish()

Result audinWaitCaptureFinish ( AudioInBuffer **  released,
u32 released_count,
u64  timeout 
)

Waits for audio capture to finish.

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