Runtime Audio Importer is an open-source plugin to import audio files of MP3, WAV and FLAC formats into the game at runtime.
It's easy to use in both C++ and Blueprints.
Plugin does not require any static libraries and external dependencies.
How to install
There're two ways to install the plugin:
- Through the marketplace.
- Manual installation. Open this GitHub Repository, extract the "RuntimeAudioImporter" folder into your plugins project folder to get the following path: "[ProjectName] / Plugins / RuntimeAudioImporter".
How to use
There are two ways to work with the plugin, for each of the methods more detailed instructions for working are relevant.
When importing, audio data is transcoded to Interleaved 32-bit IEEE floating point PCM, which in turn is divided into frames (by default, usually 2048 frames per request), which are transferred to the audio render thread, where this data is processed. These iterations happen very often.
Description of structures and enumerators
Here are descriptions of structures and enumerators that are used in the plugin as input and output parameters of certain functions.
AudioFormat enumerator. Needed to specify the format of the imported audio file.
- Determine format automatically. Select it if you want to automatically detect the audio format based on the audio file extension.
- MP3. Select if you are sure that the audio file contains MP3 data.
- WAV. Select if you are sure that the audio file contains WAV data.
- FLAC. Select if you are sure that the audio file contains FLAC data.
TranscodingStatus enumerator. Needed in order to know if the error occured or not. It can be get from "OnResult" delegate.
- SuccessImporting. When the import was successful.
- FailedToReadAudioDataArray Audio data array contains invalid data.
- SoundWaveDeclarationError. Error while initializing SoundWave object.
- InvalidAudioFormat. Can't determine the format of the audio file.
- AudioDoesNotExist. The audio file does not exist.
- LoadFileToArrayError. When it is impossible to access a file.