-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHoaLibraryUnity.h
54 lines (40 loc) · 1.98 KB
/
HoaLibraryUnity.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//==============================================================================
// HoaLibrary for Unity - version 1.0.0
// https://github.com/CICM/HoaLibrary-Unity
// Copyright (c) 2019, Eliott Paris, CICM, ArTeC.
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "LICENSE.txt," in this distribution.
// Thirdparty :
// - HoaLibrary-Light: https://github.com/CICM/HoaLibrary-Light
// - Unity nativeaudioplugins SDK: https://bitbucket.org/Unity-Technologies/nativeaudioplugins.
//==============================================================================
#pragma once
#include "HoaLibraryApi.h"
namespace HoaLibraryUnity
{
using source_id_t = HoaLibraryApi::source_id_t;
//! @brief Initializes the HoaLibrary system with Unity audio engine settings.
void Initialize(size_t vectorsize);
//! @brief Shuts down the HoaLibrary system.
void Shutdown();
//! @brief Processes the next output buffer and stores the processed buffer in |output|.
//! This method must be called from the audio thread.
void ProcessListener(size_t num_frames, float_t* output);
//! @brief Updates the listener's master gain.
void SetMasterGain(float_t gain);
//! @brief Creates an object audio source to be spatialized.
source_id_t CreateSource();
//! @brief Removes source
void DestroySource(source_id_t id);
//! @brief Passes the next input buffer of the source to the system.
void ProcessSource(source_id_t id, size_t num_frames, float_t* input);
//! @brief Sets the stereo pan
void SetSourcePan(source_id_t id, float_t pan);
//! @brief Sets the stereo pan
void SetSourceGain(source_id_t id, float_t gain);
//! @brief Updates the position of the source.
void SetSourcePosition(HoaLibraryApi::source_id_t id,
float_t px, float_t py, float_t pz);
//! @brief Sets the source ambisonic optimization.
void SetSourceOptim(HoaLibraryApi::source_id_t id, int optim);
}