C++ SDK
Seamless integration of Arctan SDK to C++ projects using CMake FetchContent, this will automatically download the required source archive and link them to your project.
Requirements
- CMake 3.15 or newer.
- A C++11 compiler.
- OpenSSL and libcurl available to CMake.
- An Arctan SDK license key.
- Network access
Integration
Add this to your CMake
include(FetchContent)
FetchContent_Declare(
arctan_vi_sdk
URL "https://mediagateway.getarctan.com:8080/sdk/release?language=cpp&dist=41c09d5c-9be2-4753-ab01-20a28fbf7727&version=0.2.0"
URL_HASH SHA256=d86e415a53c5103e4952e8f9d3ebf85f8c4a2fd2b17be2cf6771c2a19d45589f
)
FetchContent_MakeAvailable(arctan_vi_sdk)
target_link_libraries(my_audio_app PRIVATE arctan-vi)
and build your application normally
cmake -B build -S .
cmake --build build -j
License key
export ARCTAN_SDK_KEY="arc_sk_live_..."
You can also pass the key directly to arctan::Processor::create(...).
Process audio
#include "arctan.hpp"
#include <cstdlib>
#include <vector>
int main() {
const char* license_key = std::getenv("ARCTAN_SDK_KEY");
arctan::Model model = arctan::Model::create_default().take();
uint32_t sample_rate = model.get_optimal_sample_rate();
size_t num_frames = model.get_optimal_num_frames(sample_rate);
arctan::ProcessorConfig config(sample_rate, num_frames, 2);
arctan::Processor processor =
arctan::Processor::create(model, license_key).take();
processor.initialize(
config.sample_rate,
config.num_channels,
config.num_frames,
config.allow_variable_frames);
std::vector<float> audio(config.num_channels * config.num_frames, 0.0f);
processor.process_interleaved(
audio.data(),
config.num_channels,
config.num_frames);
processor.close();
}
Troubleshooting
-
If CMake cannot find OpenSSL or libcurl, install the development package for your platform and rerun CMake.
-
If authorization fails, confirm the SDK license key is valid and the application process has outbound HTTPS access.
-
If processing returns a frame-size error, use
model.get_optimal_num_frames(sample_rate)or pass a frame count that contains a whole number of native processing blocks.