Skip to content

Commit

Permalink
Merge pull request #613 from stellar-aria/feature/audio_config_as_agg…
Browse files Browse the repository at this point in the history
…regate

Change AudioHandle::Config to an aggregate type
  • Loading branch information
beserge authored Feb 21, 2024
2 parents f8e346c + f9d9548 commit 77cc624
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/hid/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,19 @@ class AudioHandle
struct Config
{
/** number of samples to process per callback */
size_t blocksize;
size_t blocksize = 48;

/**< Sample rate of audio */
SaiHandle::Config::SampleRate samplerate;
SaiHandle::Config::SampleRate samplerate
= SaiHandle::Config::SampleRate::SAI_48KHZ;

/** factor for adjustment before and after callback for hardware that may have extra headroom */
float postgain;
float postgain = 1.f;

/** factor for additional one-sided compensation to audio path for hardware that may
* have unequal input/output ranges
*/
float output_compensation;

/** Sets default values for config struct */
Config()
: blocksize(48),
samplerate(SaiHandle::Config::SampleRate::SAI_48KHZ),
postgain(1.f),
output_compensation(1.f)
{
}
float output_compensation = 1.f;
};

enum class Result
Expand Down

0 comments on commit 77cc624

Please sign in to comment.