qt_rtmp_demo/media/AudioPlayer.h

31 lines
621 B
C
Raw Normal View History

2023-11-12 16:13:24 +00:00
#pragma once
#include "stdint.h"
#include "../third/portaudio/portaudio.h"
#include "AACDecoder.h"
class AudioPlayer :public AACDecoder::AACDecoderObserver{
public:
class AudioPlayerObserver{
public:
virtual int OnAudioPlay();
};
typedef struct {
int index;
wstring name;
}SpeakerInfo;
enum PLAY_STATUS {
RUNNING = 1,
STOP = 2,
PAUSE = 3,
FAIL = 4,
};
AudioPlayer(int index);
vector<SpeakerInfo> EnumSpeakers();
int Play(uint8_t *data,uint16_t num);
int OnAudioDecode(uint8_t *dat, uint16_t size);
private:
PLAY_STATUS mStatus;
PaStreamParameters mOutputParameters;
PaStream *mOutStream;
};