| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
#ifndef miniaudio_libopus_h |
| 8 |
#define miniaudio_libopus_h |
| 9 |
|
| 10 |
#ifdef __cplusplus |
| 11 |
extern "C" { |
| 12 |
#endif |
| 13 |
|
| 14 |
#include "../../../miniaudio.h" |
| 15 |
|
| 16 |
typedef struct |
| 17 |
{ |
| 18 |
ma_data_source_base ds; |
| 19 |
ma_read_proc onRead; |
| 20 |
ma_seek_proc onSeek; |
| 21 |
ma_tell_proc onTell; |
| 22 |
void* pReadSeekTellUserData; |
| 23 |
ma_format format; |
| 24 |
void* of; |
| 25 |
} ma_libopus; |
| 26 |
|
| 27 |
MA_API ma_result ma_libopus_init(ma_read_proc onRead, ma_seek_proc onSeek, ma_tell_proc onTell, void* pReadSeekTellUserData, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_libopus* pOpus); |
| 28 |
MA_API ma_result ma_libopus_init_file(const char* pFilePath, const ma_decoding_backend_config* pConfig, const ma_allocation_callbacks* pAllocationCallbacks, ma_libopus* pOpus); |
| 29 |
MA_API void ma_libopus_uninit(ma_libopus* pOpus, const ma_allocation_callbacks* pAllocationCallbacks); |
| 30 |
MA_API ma_result ma_libopus_read_pcm_frames(ma_libopus* pOpus, void* pFramesOut, ma_uint64 frameCount, ma_uint64* pFramesRead); |
| 31 |
MA_API ma_result ma_libopus_seek_to_pcm_frame(ma_libopus* pOpus, ma_uint64 frameIndex); |
| 32 |
MA_API ma_result ma_libopus_get_data_format(ma_libopus* pOpus, ma_format* pFormat, ma_uint32* pChannels, ma_uint32* pSampleRate, ma_channel* pChannelMap, size_t channelMapCap); |
| 33 |
MA_API ma_result ma_libopus_get_cursor_in_pcm_frames(ma_libopus* pOpus, ma_uint64* pCursor); |
| 34 |
MA_API ma_result ma_libopus_get_length_in_pcm_frames(ma_libopus* pOpus, ma_uint64* pLength); |
| 35 |
|
| 36 |
|
| 37 |
extern ma_decoding_backend_vtable* ma_decoding_backend_libopus; |
| 38 |
|
| 39 |
#ifdef __cplusplus |
| 40 |
} |
| 41 |
#endif |
| 42 |
#endif |
| 43 |
|