webOS Userland
Native system APIs for webOS
lgnc_directaudio.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
17  LGNC_ADEC_FMT_UNKNOWN = 0,
22  LGNC_ADEC_FMT_AC3 = 2,
23  LGNC_ADEC_FMT_AAC = 5,
24  LGNC_ADEC_FMT_MP3 = 8,
25  LGNC_ADEC_FMT_NONE = 10
26 };
27 
28 typedef enum LGNC_ADEC_FMT_T LGNC_ADEC_FMT_T;
29 
30 enum LGNC_ADEC_CH_INDEX_T {
31  LGNC_ADEC_CH_INDEX_MAIN = 0,
32  LGNC_ADEC_CH_INDEX_BUF0 = 1
33 };
34 
35 typedef enum LGNC_ADEC_CH_INDEX_T LGNC_ADEC_CH_INDEX_T;
36 
78  LGNC_ADEC_SAMPLING_FREQ_NONE = 0,
79 };
80 
82 
88 static inline LGNC_ADEC_SAMPLING_FREQ_T LGNC_ADEC_SAMPLING_FREQ_OF(int hertz) {
89  switch (hertz) {
90  case 4000:
92  case 8000:
94  case 11025:
96  case 12000:
98  case 16000:
100  case 22050:
102  case 24000:
104  case 32000:
106  case 44100:
108  case 48000:
110  default:
111  return LGNC_ADEC_SAMPLING_FREQ_NONE;
112  }
113 }
114 
120  LGNC_ADEC_CH_INDEX_T AChannel;
128  unsigned int numberOfChannel;
132  unsigned int bitPerSample;
133 };
134 
136 
137 int LGNC_DIRECTAUDIO_CheckBuffer(int *length);
138 
144 
151 
158 int LGNC_DIRECTAUDIO_Play(const void *data, unsigned int size);
159 
160 #ifdef __cplusplus
161 }
162 #endif
LGNC_ADEC_FMT_T
Audio format.
Definition: lgnc_directaudio.h:16
@ LGNC_ADEC_FMT_PCM
PCM.
Definition: lgnc_directaudio.h:21
LGNC_ADEC_SAMPLING_FREQ_T
Definition: lgnc_directaudio.h:37
@ LGNC_ADEC_SAMPLING_FREQ_12_KHZ
12000 Hz
Definition: lgnc_directaudio.h:53
@ LGNC_ADEC_SAMPLING_FREQ_44_1KHZ
44100 Hz
Definition: lgnc_directaudio.h:73
@ LGNC_ADEC_SAMPLING_FREQ_16_KHZ
16000 Hz
Definition: lgnc_directaudio.h:57
@ LGNC_ADEC_SAMPLING_FREQ_11_025KHZ
11025 Hz
Definition: lgnc_directaudio.h:49
@ LGNC_ADEC_SAMPLING_FREQ_22_05KHZ
22050 Hz
Definition: lgnc_directaudio.h:61
@ LGNC_ADEC_SAMPLING_FREQ_48_KHZ
48000 Hz
Definition: lgnc_directaudio.h:77
@ LGNC_ADEC_SAMPLING_FREQ_8_KHZ
8000 Hz
Definition: lgnc_directaudio.h:45
@ LGNC_ADEC_SAMPLING_FREQ_24_KHZ
24000 Hz
Definition: lgnc_directaudio.h:65
@ LGNC_ADEC_SAMPLING_FREQ_32_KHZ
32000 Hz
Definition: lgnc_directaudio.h:69
@ LGNC_ADEC_SAMPLING_FREQ_4_KHZ
4000 Hz
Definition: lgnc_directaudio.h:41
int LGNC_DIRECTAUDIO_Play(const void *data, unsigned int size)
Play audio buffer.
int LGNC_DIRECTAUDIO_Close()
Close audio playback.
int LGNC_DIRECTAUDIO_Open(LGNC_ADEC_DATA_INFO_T *info)
Open audio playback.
Definition: lgnc_directaudio.h:115
unsigned int numberOfChannel
Number of channels.
Definition: lgnc_directaudio.h:128
LGNC_ADEC_FMT_T codec
Audio format.
Definition: lgnc_directaudio.h:119
LGNC_ADEC_SAMPLING_FREQ_T samplingFreq
Sampling frequency.
Definition: lgnc_directaudio.h:124
unsigned int bitPerSample
Bit per sample.
Definition: lgnc_directaudio.h:132