TpSound 类
V0.2.1TpExtUtils
2025-11-14
基础信息
| 头文件: | include <TpSound.h> |
|---|---|
| Cmake: | None |
| 发布版本: | V0.2.1 |
| 继承类: | |
| 派生类: |
Public 成员函数
| TpSound(const TpString &name) | ||
|---|---|---|
| TpSound(TpAudioInterface *audio) | ||
| ~TpSound() | ||
| setAudio(TpAudioInterface *audio) | 设置绑定的应用,如果社设置应用音量需要绑定应用或者在构造的时候绑定 | |
| TpAudioInterface * | getAudio() | 获取已经绑定的应用 |
| setVolume(tpUInt8 volume) | 设置应用音量 | |
| getVolume() | 获取应用音量 | |
| setSystemVolume(tpUInt8 volume) | 设置系统音量 | |
| getSystemVolume() | 获取系统音量 | |
| static TpList< TpString > | getDevices() | 获取本机声卡设备列表,可直接使用返回的名字创建音频类(内部直接使用tpAudioInterface) |
| static TpString | getUsedDevice() | 获取使用中的设备 |
| setUsedDevice(const TpString &name) | 设置使用的声卡设备 |
成员函数说明
TpSound::TpSound(const TpString &name)
暂无注释...
TpSound::TpSound(TpAudioInterface *audio)
暂无注释...
TpSound::~TpSound()
暂无注释...
int TpSound::setAudio(TpAudioInterface *audio)
设置绑定的应用,如果社设置应用音量需要绑定应用或者在构造的时...
设置绑定的应用,如果社设置应用音量需要绑定应用或者在构造的时候绑定
参数:audio:
返回值:
TpAudioInterface * TpSound::getAudio()
获取已经绑定的应用...
获取已经绑定的应用
返回值:
int TpSound::setVolume(tpUInt8 volume)
设置应用音量...
设置应用音量
参数:volume:
返回值:
int TpSound::getVolume()
获取应用音量...
获取应用音量
返回值:
int TpSound::setSystemVolume(tpUInt8 volume)
设置系统音量...
设置系统音量
参数:volume: 音量,0~100
返回值:
int TpSound::getSystemVolume()
获取系统音量...
获取系统音量
返回值:
static TpList< TpString > TpSound::getDevices()
获取本机声卡设备列表,可直接使用返回的名字创建音频类(内部直...
获取本机声卡设备列表,可直接使用返回的名字创建音频类(内部直接使用tpAudioInterface)
返回值:
static TpString TpSound::getUsedDevice()
获取使用中的设备...
获取使用中的设备
返回值:
static tpBool TpSound::setUsedDevice(const TpString &name)
设置使用的声卡设备...
设置使用的声卡设备
参数:name: 设备名,建议使用getDevices获取
返回值:
