NIM 提供的语音录制和播放接口
更多...
#include <nim_audio_cpp.h>
|
static bool | Init (const std::wstring &user_data_parent_path, const std::wstring &dll_path=L"") |
|
static void | Cleanup () |
|
static bool | PlayAudio (const wchar_t *file_path, const char *call_id, const char *res_id, nim_audio_type audio_format) |
|
static bool | PlayAudio (const wchar_t *file_path, const char *call_id, const char *res_id, nim_audio_type audio_format, int seek) |
|
static bool | StopPlayAudio () |
|
static bool | RegStartPlayCb (nim_rescode_id_cb cb) |
|
static bool | RegStopPlayCb (nim_rescode_id_cb cb) |
|
static bool | RegStartCaptureCb (nim_rescode_cb cb) |
|
static bool | RegStopCaptureCb (nim_stop_capture_cb cb) |
|
static bool | RegCancelAudioCb (nim_rescode_cb cb) |
|
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 | StopCapture () |
|
static bool | CancelAudio (const wchar_t *file_path) |
|
static bool | RegEnumCaptureDeviceCb (nim_enum_capture_device_cb cb) |
|
static bool | EnumCaptureDevice () |
|
|
template<typename F > |
static F | Function (const char *function_name) |
|
◆ CancelAudio()
bool nim_audio::Audio::CancelAudio |
( |
const wchar_t * |
file_path | ) |
|
|
static |
NIM SDK 取消录制并删除临时文件
- 返回
- bool true 调用成功,false 调用失败
◆ Cleanup()
void nim_audio::Audio::Cleanup |
( |
| ) |
|
|
static |
void Cleanup() NIM SDK 卸载语音模块(只有在主程序关闭时才有必要调用此接口)
- 返回
- bool true 调用成功,false 调用失败
◆ EnumCaptureDevice()
bool nim_audio::Audio::EnumCaptureDevice |
( |
| ) |
|
|
static |
NIM SDK 枚举本地录音采集设备
- 返回
- bool true 调用成功,false 调用失败
◆ Function()
template<typename F >
static F nim_audio::Audio::Function |
( |
const char * |
function_name | ) |
|
|
inlinestaticprivate |
◆ Init()
bool nim_audio::Audio::Init |
( |
const std::wstring & |
user_data_parent_path, |
|
|
const std::wstring & |
dll_path = L"" |
|
) |
| |
|
static |
bool Init(const std::wstring& user_data_parent_path,const std::wstring& dll_path = L"") NIM SDK 初始化语音模块
- 参数
-
[in] | user_data_parent_path | 缓存目录 |
[in] | dll_path | 语音模块所在目录 |
- 返回
- bool true 调用成功,false 调用失败
◆ PlayAudio() [1/2]
bool nim_audio::Audio::PlayAudio |
( |
const wchar_t * |
file_path, |
|
|
const char * |
call_id, |
|
|
const char * |
res_id, |
|
|
nim_audio_type |
audio_format |
|
) |
| |
|
static |
◆ PlayAudio() [2/2]
bool nim_audio::Audio::PlayAudio |
( |
const wchar_t * |
file_path, |
|
|
const char * |
call_id, |
|
|
const char * |
res_id, |
|
|
nim_audio_type |
audio_format, |
|
|
int |
seek |
|
) |
| |
|
static |
◆ RegCancelAudioCb()
注册取消录制并删除临时文件事件回调
- 参数
-
[in] | cb | 回调函数 见nim_audio_def.h |
- 返回
- bool true 调用成功,false 调用失败
◆ RegEnumCaptureDeviceCb()
注册枚举本地录音采集设备回调
- 参数
-
[in] | cb | 回调函数 见nim_audio_def.h |
- 返回
- bool true 调用成功,false 调用失败
◆ RegStartCaptureCb()
注册录制语音回调
- 参数
-
[in] | cb | 回调函数 见nim_audio_def.h |
- 返回
- bool true 调用成功,false 调用失败
◆ RegStartPlayCb()
◆ RegStopCaptureCb()
注册录制语音结束回调
- 参数
-
[in] | cb | 回调函数 见nim_audio_def.h |
- 返回
- bool true 调用成功,false 调用失败
◆ RegStopPlayCb()
◆ StartCapture()
bool nim_audio::Audio::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 |
- 参数
-
[in] | call_id | 用以定位资源的一级ID,可选 |
[in] | res_id | 用以定位资源的二级ID,可选 |
[in] | audio_format | 音频格式,AAC : 0, AMR : 1 |
[in] | volume | 音量(0 - 255, 默认180) |
[in] | capture_device | 采集设备 |
- 返回
- bool true 调用成功,false 调用失败
◆ StopCapture()
bool nim_audio::Audio::StopCapture |
( |
| ) |
|
|
static |
NIM SDK 停止录制语音
- 返回
- bool true 调用成功,false 调用失败
◆ StopPlayAudio()
bool nim_audio::Audio::StopPlayAudio |
( |
| ) |
|
|
static |
◆ instance_audio_
HINSTANCE nim_audio::Audio::instance_audio_ = NULL |
|
staticprivate |
该类的文档由以下文件生成:
- D:/GitLab/builds/5sbaxrcd/0/nim-pc/california/nim-cross-platform-sdk/exports/wrapper/nim_tools_cpp_wrapper/nim_audio_cpp.h
- D:/GitLab/builds/5sbaxrcd/0/nim-pc/california/nim-cross-platform-sdk/exports/wrapper/nim_tools_cpp_wrapper/nim_audio_cpp.cpp