NIM 提供的语音录制和播放接口
More...
#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 () |
|
◆ CancelAudio()
bool nim_audio::Audio::CancelAudio |
( |
const wchar_t * |
file_path | ) |
|
|
static |
NIM SDK 取消录制并删除临时文件
- Returns
- bool true 调用成功,false 调用失败
◆ Cleanup()
void nim_audio::Audio::Cleanup |
( |
| ) |
|
|
static |
void Cleanup() NIM SDK 卸载语音模块(只有在主程序关闭时才有必要调用此接口)
- Returns
- bool true 调用成功,false 调用失败
◆ EnumCaptureDevice()
bool nim_audio::Audio::EnumCaptureDevice |
( |
| ) |
|
|
static |
NIM SDK 枚举本地录音采集设备
- Returns
- bool true 调用成功,false 调用失败
◆ 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 初始化语音模块
- Parameters
-
[in] | user_data_parent_path | 缓存目录 |
[in] | dll_path | 语音模块所在目录 |
- Returns
- 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()
注册取消录制并删除临时文件事件回调
- Parameters
-
[in] | cb | 回调函数 见nim_audio_def.h |
- Returns
- bool true 调用成功,false 调用失败
◆ RegEnumCaptureDeviceCb()
注册枚举本地录音采集设备回调
- Parameters
-
[in] | cb | 回调函数 见nim_audio_def.h |
- Returns
- bool true 调用成功,false 调用失败
◆ RegStartCaptureCb()
注册录制语音回调
- Parameters
-
[in] | cb | 回调函数 见nim_audio_def.h |
- Returns
- bool true 调用成功,false 调用失败
◆ RegStartPlayCb()
◆ RegStopCaptureCb()
注册录制语音结束回调
- Parameters
-
[in] | cb | 回调函数 见nim_audio_def.h |
- Returns
- 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 |
- Parameters
-
[in] | call_id | 用以定位资源的一级ID,可选 |
[in] | res_id | 用以定位资源的二级ID,可选 |
[in] | audio_format | 音频格式,AAC : 0, AMR : 1 |
[in] | volume | 音量(0 - 255, 默认180) |
[in] | capture_device | 采集设备 |
- Returns
- bool true 调用成功,false 调用失败
◆ StopCapture()
bool nim_audio::Audio::StopCapture |
( |
| ) |
|
|
static |
NIM SDK 停止录制语音
- Returns
- bool true 调用成功,false 调用失败
◆ StopPlayAudio()
bool nim_audio::Audio::StopPlayAudio |
( |
| ) |
|
|
static |
bool StopPlayAudio() NIM SDK 停止播放,通过回调获取停止播放状态
- Returns
- bool true 调用成功,false 调用失败
The documentation for this class was generated from the following files: