8 #ifndef _NIM_TOOLS_SDK_CPP_AUDIO_H_ 9 #define _NIM_TOOLS_SDK_CPP_AUDIO_H_ 24 #include "../../nim_tools_c_sdk/audio/nim_audio_def.h" 39 static bool Init(
const std::wstring& user_data_parent_path,
const std::wstring& dll_path = L
"");
55 static bool PlayAudio(
const wchar_t* file_path,
const char* call_id,
const char* res_id,
nim_audio_type audio_format);
66 static bool PlayAudio(
const wchar_t* file_path,
const char* call_id,
const char* res_id,
nim_audio_type audio_format,
int seek);
118 static bool StartCapture(
const char* call_id,
const char* res_id,
nim_audio_type audio_format =
AAC,
int volume = 180,
const wchar_t* capture_device =
nullptr);
146 template <
typename F>
147 static F Function(
const char* function_name)
149 F f = (F) ::GetProcAddress(instance_audio_, function_name);
155 static HINSTANCE instance_audio_;
160 #endif //_NIM_TOOLS_SDK_CPP_AUDIO_H_
static bool Init(const std::wstring &user_data_parent_path, const std::wstring &dll_path=L"")
static bool CancelAudio(const wchar_t *file_path)
static bool RegStopCaptureCb(nim_stop_capture_cb cb)
NIM 提供的语音录制和播放接口
Definition: nim_audio_cpp.h:29
static bool RegCancelAudioCb(nim_rescode_cb cb)
static bool RegStartCaptureCb(nim_rescode_cb cb)
void(* nim_stop_capture_cb)(int rescode, const char *call_id, const char *res_id, const char *file_path, const char *file_ext, long file_size, int audio_duration)
Definition: nim_audio_def.h:62
static bool StopCapture()
static bool EnumCaptureDevice()
void(* nim_rescode_id_cb)(int rescode, const char *file_path, const char *call_id, const char *res_id)
Definition: nim_audio_def.h:49
static bool StopPlayAudio()
void(* nim_rescode_cb)(int)
Definition: nim_audio_def.h:40
static bool PlayAudio(const wchar_t *file_path, const char *call_id, const char *res_id, nim_audio_type audio_format)
static bool RegStopPlayCb(nim_rescode_id_cb cb)
void(* nim_enum_capture_device_cb)(int rescode, const wchar_t *device_list)
Definition: nim_audio_def.h:69
static bool StartCapture(const char *call_id, const char *res_id, nim_audio_type audio_format=AAC, int volume=180, const wchar_t *capture_device=nullptr)
static bool RegEnumCaptureDeviceCb(nim_enum_capture_device_cb cb)
static bool RegStartPlayCb(nim_rescode_id_cb cb)
nim_audio_type
Definition: nim_audio_def.h:30
Definition: nim_audio_def.h:32