|
OpenTTD Source 20260206-master-g4d4e37dbf1
|
Raw PCM sound loader, used as a fallback if other sound loaders fail. More...
Public Member Functions | |
| bool | Load (SoundEntry &sound, bool new_format, std::vector< std::byte > &data) const override |
| Load a sound from the file and offset in the given sound entry. | |
| 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< SoundLoader > | |
| 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 | RAW_SAMPLE_RATE = 11025 |
| Sample rate of raw pcm samples. | |
| static constexpr uint8_t | RAW_SAMPLE_BITS = 8 |
| Bit depths of raw pcm samples. | |
Static Private Attributes | |
| static SoundLoader_Raw | instance {} |
Additional Inherited Members | |
| Protected Attributes inherited from PriorityBaseProvider< SoundLoader > | |
| const int | priority |
| Protected Attributes inherited from BaseProvider< SoundLoader > | |
| const std::string_view | name |
| const std::string_view | description |
Raw PCM sound loader, used as a fallback if other sound loaders fail.
Definition at line 18 of file soundloader_raw.cpp.
|
inline |
Definition at line 20 of file soundloader_raw.cpp.
|
inlineoverridevirtual |
Load a sound from the file and offset in the given sound entry.
It is up to the implementations to update the sound's channels, bits_per_sample and rate.
| sound | The entry to load. | |
| new_format | Whether this is an old format soundset (with some buggy data), or the new format. | |
| [out] | data | The vector to write the decoded sound data into. |
true iff the entry was loaded correctly. Implements SoundLoader.
Definition at line 25 of file soundloader_raw.cpp.
References RAW_SAMPLE_BITS, RAW_SAMPLE_RATE, and RandomAccessFile::ReadBlock().
|
staticprivate |
Definition at line 55 of file soundloader_raw.cpp.
|
staticconstexpr |
Bit depths of raw pcm samples.
Definition at line 23 of file soundloader_raw.cpp.
Referenced by Load().
|
staticconstexpr |
Sample rate of raw pcm samples.
Definition at line 22 of file soundloader_raw.cpp.
Referenced by Load().