|
muteki
|
Audio API. More...
Go to the source code of this file.
Data Structures | |
| struct | pcm_config_s |
| The PCM codec configuration. More... | |
| struct | pcm_codec_context_s |
| The PCM codec context. More... | |
| struct | device_service_pcm_s |
| struct | pcm_state_s |
| struct | pcm_frame_s |
| PCM frame data structure. Used internally. More... | |
| struct | pcm_decoder_buffer_s |
| Codec buffer descriptor. Used Internally. More... | |
Typedefs | |
| typedef struct device_service_pcm_s | device_service_pcm_t |
| typedef struct pcm_config_s | pcm_config_t |
| typedef struct pcm_codec_context_s | pcm_codec_context_t |
| typedef struct pcm_state_s | pcm_state_t |
| typedef struct pcm_frame_s | pcm_frame_t |
| typedef struct pcm_decoder_buffer_s | pcm_decoder_buffer_t |
| typedef void(* | pcm_codec_func_t) (device_service_pcm_t *pcm, pcm_decoder_buffer_t *src, pcm_decoder_buffer_t *dest) |
Enumerations | |
| enum | pcm_direction_e { DIRECTION_DEFAULT , DIRECTION_OUT , DIRECTION_IN } |
| PCM codec direction/mode. More... | |
| enum | pcm_format_e { FORMAT_AUTO = -1 , FORMAT_PCM_MONO = 1 , FORMAT_PCM_STEREO = 3 } |
| Sample format. More... | |
Functions | |
| pcm_codec_context_t * | OpenPCMCodec (int direction, int sample_rate, int format) |
| Create PCM codec context. | |
| void | ClosePCMCodec (pcm_codec_context_t *ctx) |
| Destroy a PCM codec context. | |
Variables | |
| const int | SAMPLE_RATE_AUTO = -1 |
| Use the default sample rate. Usually this is equivalent to 44100Hz. | |
Audio API.
| enum pcm_direction_e |
PCM codec direction/mode.
| Enumerator | |
|---|---|
| DIRECTION_DEFAULT | Default direction. Usually DIRECTION_OUT. |
| DIRECTION_OUT | Output/playback mode. |
| DIRECTION_IN | Input/recording mode. |
| enum pcm_format_e |
Sample format.
| Enumerator | |
|---|---|
| FORMAT_AUTO | Use the default format. Usually FORMAT_PCM_STEREO. |
| FORMAT_PCM_MONO | PCM mono. |
| FORMAT_PCM_STEREO | PCM stereo. |
|
extern |
Destroy a PCM codec context.
0x10251 | ctx | The context. |
|
extern |
Create PCM codec context.
Use this to play/record audio in a streaming manner.
This changes the configuration of the \\?\PCM service. More details TBA.
The context object can be used directly, but it's recommended to open another descriptor using the CreateFile() syscall, and use ReadFile() / WriteFile() / DeviceIoControl() to access the device.
For example, below is a simple loop that uses both the PCM and the device IO syscalls together to play samples:
0x10250| direction | Direction. Can either be input (record) or output (playback). |
| sample_rate | Sample rate. |
| format | Sample format. |