Audio Effects SDK
AI-powered SDK for real-time audio enhancement.
Loading...
Searching...
No Matches
sdk_factory.h
Go to the documentation of this file.
1#ifndef AUDIO_EFFECTS_SDK_INCLUDE_FACTORY_H
2#define AUDIO_EFFECTS_SDK_INCLUDE_FACTORY_H
3
5
6#if defined(__clang__) || defined(__GNUC__)
7#if __x86_64__
8#define AESDK_CALLBACK
9#else
10#define AESDK_CALLBACK __attribute__((__cdecl__))
11#endif
12#define AESDK_API_EXPORT
13#define AESDK_API_DECL
14#else
15#define AESDK_CALLBACK __cdecl
16#define AESDK_API_EXPORT __declspec(dllexport)
17#define AESDK_API_DECL __cdecl
18#endif
19
20#include "audio_format.h"
21#include "pipeline.h"
22
23namespace audio_effects_sdk {
24
26enum AuthStatus : int
27{
29 error = 0,
31 active = 1,
36};
37
39class IAuthResult : public IRelease
40{
41public:
43 virtual AuthStatus status() const = 0;
44};
45
50typedef void(AESDK_CALLBACK *pfnOnAuthCompletedCallback)(IAuthResult* result, void* ctx);
51
55class ISDKFactory : public IRelease
56{
57public:
69 virtual IAuthResult* auth(const char* customerID, pfnOnAuthCompletedCallback callback, void* ctx) = 0;
70
80 virtual IAuthResult* authWithAPIUrl(const char* customerID, const char* customApiUrl, pfnOnAuthCompletedCallback callback, void* ctx) = 0;
81
86 virtual IAuthResult* authWithKey(const char* key) = 0;
87
96 virtual IPipeline* createPipeline(AudioFormatType format, uint32_t sampleRate, uint32_t channels, float pcmScale) = 0;
97
101 virtual void waitUntilAsyncWorkFinished() = 0;
102};
103
104}
105
106
107
108extern "C" AESDK_API_EXPORT
110AESDK_API_DECL
113
114#endif
AudioFormatType
Format of audio frames that the SDK work with.
Definition audio_format.h:11
Contains authorization process results.
Definition sdk_factory.h:40
virtual AuthStatus status() const =0
The status of authorization process.
Audio processing interface that applies noise suppression.
Definition pipeline.h:38
Definition irelease.h:7
SDK entry point for creating pipelines and handling authorization.
Definition sdk_factory.h:56
virtual IPipeline * createPipeline(AudioFormatType format, uint32_t sampleRate, uint32_t channels, float pcmScale)=0
Creates audio processing pipeline instance.
virtual IAuthResult * authWithKey(const char *key)=0
Offline authorization with a secret key.
virtual void waitUntilAsyncWorkFinished()=0
Wait until all started async tasks are finished.
virtual IAuthResult * authWithAPIUrl(const char *customerID, const char *customApiUrl, pfnOnAuthCompletedCallback callback, void *ctx)=0
Authenticates SDK instance online with custom server.
virtual IAuthResult * auth(const char *customerID, pfnOnAuthCompletedCallback callback, void *ctx)=0
Authenticates SDK instance online.
AESDK_API_EXPORT audio_effects_sdk::ISDKFactory *AESDK_API_DECL createAudioEffectsSDKFactory()
Creates an instance of ISDKFactory.
AuthStatus
Describes result of authorization process.
Definition sdk_factory.h:27
@ active
Authorization finished successfully, the SDK can be used.
Definition sdk_factory.h:31
@ error
Authorization finished with error (e.g., missing internet connection).
Definition sdk_factory.h:29
@ inactive
Such customer has no license or the license revoked.
Definition sdk_factory.h:33
@ expired
The license is expired.
Definition sdk_factory.h:35
void(AESDK_CALLBACK * pfnOnAuthCompletedCallback)(IAuthResult *result, void *ctx)
Callback triggered when the authorization process is complete.
Definition sdk_factory.h:50