mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 15:07:17 -04:00
This refactoring removes invalid interface dependencies of the original AudioDevice implementation: - move things characteristic to RT1051AudioCodec to audio::codec - remove dead methods - make start/stop optional and codec configuration independent - add more convenient way to get supported formats Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace audio::codec
|
|
{
|
|
enum class Flags
|
|
{
|
|
OutputMono = 1 << 0,
|
|
OutputStereo = 1 << 1,
|
|
InputLeft = 1 << 2,
|
|
InputRight = 1 << 3,
|
|
InputStereo = 1 << 4
|
|
};
|
|
|
|
enum class InputPath
|
|
{
|
|
Headphones,
|
|
Microphone,
|
|
None
|
|
};
|
|
|
|
enum class OutputPath
|
|
{
|
|
Headphones,
|
|
Earspeaker,
|
|
Loudspeaker,
|
|
None
|
|
};
|
|
|
|
struct Configuration
|
|
{
|
|
std::uint32_t sampleRate_Hz = 0; /*!< Sample rate of audio data */
|
|
std::uint32_t bitWidth = 0; /*!< Data length of audio data, usually 8/16/24/32 bits */
|
|
std::uint32_t flags = 0; /*!< In/Out configuration flags */
|
|
float outputVolume = 0.0f;
|
|
float inputGain = 0.0f;
|
|
InputPath inputPath = InputPath::None;
|
|
OutputPath outputPath = OutputPath::None;
|
|
};
|
|
|
|
} // namespace audio::codec
|