OpenTTD Source: SoundLoader_Opus Class Reference

OpenTTD Source 15.0-beta1

Data Structures | Public Member Functions | Static Public Attributes
SoundLoader_Opus Class Reference

Opus sound loader. More...

Inheritance diagram for SoundLoader_Opus:

## Data Structures
struct | OggOpusFileDeleter
| Helper class to RAII release an OggOpusFile. More...

## Public Member Functions
bool | Load (SoundEntry &sound, bool new_format, std::vector< uint8_t > &data) override
Public Member Functions inherited from SoundLoader
| SoundLoader (std::string_view name, std::string_view description, int priority)
Public Member Functions inherited from PriorityBaseProvider< SoundLoader >
constexpr | PriorityBaseProvider (std::string_view name, std::string_view description, int priority)
int | GetPriority () const
Public Member Functions inherited from BaseProvider< T >
constexpr | BaseProvider (std::string_view name, std::string_view description)
std::string_view | GetName () const
std::string_view | GetDescription () const

## Static Public Attributes
static constexpr uint16_t | OPUS_SAMPLE_RATE = 48000
| OpusFile always decodes at 48kHz.
static constexpr uint8_t | OPUS_SAMPLE_BITS = 16
| OpusFile op_read() uses 16 bits per sample.
static constexpr size_t | MIN_OPUS_FILE_SIZE = 57U
static constexpr size_t | DECODE_BUFFER_SAMPLES = 5760 * 2
static constexpr size_t | DECODE_BUFFER_BYTES = DECODE_BUFFER_SAMPLES * sizeof(opus_int16)

## Additional Inherited Members
Protected Attributes inherited from PriorityBaseProvider< SoundLoader >
const int | priority
Protected Attributes inherited from BaseProvider< T >
const std::string_view | name
const std::string_view | description

## Detailed Description

Opus sound loader.

Definition at line 20 of file soundloader_opus.cpp.

## Constructor & Destructor Documentation

## ◆ SoundLoader_Opus()

SoundLoader_Opus::SoundLoader_Opus | ( |  | ) |
| inline

Definition at line 22 of file soundloader_opus.cpp.

## Member Function Documentation

## ◆ Load()

bool SoundLoader_Opus::Load | ( | SoundEntry & | sound,
|  | bool | new_format,
|  | std::vector< uint8_t > & | data
| ) |  |
| inlineoverridevirtual

Implements SoundLoader.

Definition at line 35 of file soundloader_opus.cpp.

## Field Documentation

## ◆ DECODE_BUFFER_BYTES

constexpr size_t SoundLoader_Opus::DECODE_BUFFER_BYTES = DECODE_BUFFER_SAMPLES * sizeof(opus_int16)
| staticconstexpr

Definition at line 33 of file soundloader_opus.cpp.

## ◆ DECODE_BUFFER_SAMPLES

constexpr size_t SoundLoader_Opus::DECODE_BUFFER_SAMPLES = 5760 * 2
| staticconstexpr

Definition at line 32 of file soundloader_opus.cpp.

## ◆ MIN_OPUS_FILE_SIZE

constexpr size_t SoundLoader_Opus::MIN_OPUS_FILE_SIZE = 57U
| staticconstexpr

Definition at line 28 of file soundloader_opus.cpp.

## ◆ OPUS_SAMPLE_BITS

constexpr uint8_t SoundLoader_Opus::OPUS_SAMPLE_BITS = 16
| staticconstexpr

OpusFile op_read() uses 16 bits per sample.

Definition at line 25 of file soundloader_opus.cpp.

## ◆ OPUS_SAMPLE_RATE

constexpr uint16_t SoundLoader_Opus::OPUS_SAMPLE_RATE = 48000
| staticconstexpr

OpusFile always decodes at 48kHz.

Definition at line 24 of file soundloader_opus.cpp.

The documentation for this class was generated from the following file:

- src/soundloader_opus.cpp