This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-text-to-speech/include/aws/text-to-speech/linux/PulseAudioPCMOutputDriver.h

43 lines
1.3 KiB
C
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/text-to-speech/PCMOutputDriver.h>
#include <pulse/simple.h>
namespace Aws
{
namespace TextToSpeech
{
/**
* PulseAudio implementation for PCM output.
*/
class PulseAudioPCMOutputDriver : public PCMOutputDriver
{
public:
PulseAudioPCMOutputDriver();
virtual ~PulseAudioPCMOutputDriver();
PulseAudioPCMOutputDriver(const PulseAudioPCMOutputDriver&) = delete;
PulseAudioPCMOutputDriver& operator=(const PulseAudioPCMOutputDriver&) = delete;
PulseAudioPCMOutputDriver(PulseAudioPCMOutputDriver&&) = delete;
PulseAudioPCMOutputDriver& operator=(PulseAudioPCMOutputDriver&&) = delete;
bool WriteBufferToDevice(const unsigned char* buffer, size_t bufferSize) override;
Aws::Vector<DeviceInfo> EnumerateDevices() const override;
void SetActiveDevice(const DeviceInfo& device, const CapabilityInfo& capabilities) override;
const char* GetName() const override;
private:
void InitDevice();
DeviceInfo m_activeDevice;
pa_simple* m_driver;
pa_sample_spec m_selectedCaps;
};
}
}