Here I will show you how to pre-import audio files into the editor using the Runtime Audio Importer plugin.
The plugin only supports pre-importing of the MP3 file format into the engine. This is intentional because this format supports the highest possible compression compared to WAV and FLAC.
To import an audio file into the editor, you need to make sure that all media plugins that are in any way related to the MP3 format are disabled. If it is not possible to disable them, you should rename the file extension from ".mp3" to ".imp" in order to successfully import the audio as an "Preimported Sound" asset.
Let's say we have an audio file called "AudioTest.mp3" that we need to import into the editor.
In case you have not disabled all media plugins associated with the .mp3 file extension, you need to rename the file to the .imp format. So the name of the file was "AudioTest.mp3", and then it became "AudioTest.imp".
To import it, simply drag the audio file from the explorer to the editor using the Drag & Drop method.
If errors occur when importing an audio file, the editor will warn you about this and you will see an error message in the console logs.
To use the imported sound, create Runtime Audio Importer object, bind the needed delegates and call the "Import Audio from Preimported Sound" method: