HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
AndroidAudioA.h
Go to the documentation of this file.
1#pragma once
2#if defined(__ANDROID__) && (__ANDROID_API__ >= HEPHAUDIO_ANDROID_AAUDIO_MIN_API_LEVEL)
3#include "HephAudioShared.h"
4#include "AndroidAudioBase.h"
6#include <aaudio/AAudio.h>
7
10namespace HephAudio
11{
12 namespace Native
13 {
19 {
20 public:
21 using NativeAudio::InitializeRender;
22 using NativeAudio::InitializeCapture;
23
24 private:
25 AAudioParams params;
26 AAudioStream* pRenderStream;
27 AAudioStream* pCaptureStream;
28 size_t renderBufferFrameCount;
29 size_t captureBufferFrameCount;
30 double masterVolume;
31
32 public:
35
36 AndroidAudioA(const AndroidAudioA&) = delete;
37 AndroidAudioA& operator=(const AndroidAudioA&) = delete;
38
41
42 void SetMasterVolume(double volume) override;
43 double GetMasterVolume() const override;
44 void InitializeRender(AudioDevice* device, AudioFormatInfo format) override;
45 void StopRendering() override;
46 void InitializeCapture(AudioDevice* device, AudioFormatInfo format) override;
47 void StopCapturing() override;
48 void GetNativeParams(NativeAudioParams& nativeParams) const override;
49 void SetNativeParams(const NativeAudioParams& nativeParams) override;
50
51 private:
52 double GetFinalAOVolume(AudioObject* pAudioObject) const override;
53 static aaudio_data_callback_result_t RenderCallback(AAudioStream* stream, void* userData, void* audioData, int32_t numFrames);
54 static aaudio_data_callback_result_t CaptureCallback(AAudioStream* stream, void* userData, void* audioData, int32_t numFrames);
55 static void ErrorCallback(AAudioStream* stream, void* userData, aaudio_result_t error);
56 };
57 }
58}
59#endif
#define HEPH_API
Definition HephShared.h:132
uses AAudio.
Definition AndroidAudioA.h:19
void GetNativeParams(NativeAudioParams &nativeParams) const override
double GetMasterVolume() const override
void SetNativeParams(const NativeAudioParams &nativeParams) override
void InitializeCapture(AudioDevice *device, AudioFormatInfo format) override
void SetMasterVolume(double volume) override
void InitializeRender(AudioDevice *device, AudioFormatInfo format) override
base class for classes that interact with the Android audio APIs.
Definition AndroidAudioBase.h:21
stores information about an audio device.
Definition AudioDevice.h:76
stores the properties of the audio signals
Definition AudioFormatInfo.h:20
stores information that's necessary to play audio.
Definition AudioObject.h:36
struct for storing the AAudio specific parameters.
Definition AAudioParams.h:18
base class for storing the native audio API specific parameters.
Definition NativeAudioParams.h:15