1 Star 0 Fork 0

dosmlp / SoundR-Server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
device.h 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
dosmlp 提交于 2017-08-16 20:38 . 添加文件
#ifndef DEVICE_H
#define DEVICE_H
#include <QObject>
#include <mmdeviceapi.h>
#include <Audioclient.h>
#include <Endpointvolume.h>
#include <Functiondiscoverykeys_devpkey.h>
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libswresample/swresample.h"
}
#define SAFE_RELEASE(punk) \
if ((punk) != NULL) \
{ (punk)->Release(); (punk) = NULL; }
class device : public QObject
{
Q_OBJECT
public:
explicit device(QObject *parent = nullptr);
~device();
bool open(int index);
bool close();
QStringList list() const;
void getBuffer(char** buffer, int &size, uint *nextPacketSize);
signals:
private:
void init();
IMMDeviceEnumerator *m_enumerator = nullptr;
IMMDeviceCollection *m_collection = nullptr;
IMMDevice *m_device = nullptr;
IAudioClient* m_audio_client = nullptr;
IAudioCaptureClient* m_audio_client_capture = nullptr;
WAVEFORMATEX* m_waveformat = nullptr;
QStringList m_device_list;
//音频格式转换
SwrContext* m_swr = nullptr;
void initSwr();
uchar* m_out_audio_data = nullptr;
};
#endif // DEVICE_H
C++
1
https://gitee.com/dosmlp/SoundR-Server.git
git@gitee.com:dosmlp/SoundR-Server.git
dosmlp
SoundR-Server
SoundR-Server
master

搜索帮助