Using the browser - Hello-Meow/AudioImporter GitHub Wiki
The package also includes a simple file browser, in the form of a prefab with an attached Browser Component. The browser uses Unity's UI system, so the prefab has to be parented to a Canvas.
Use the Browser Component's FileSelected event to handle selected files.
using UnityEngine;
public class ImporterExample : MonoBehaviour
{
public Browser browser;
public AudioImporter importer;
public AudioSource audioSource;
void Awake()
{
browser.FileSelected += OnFileSelected;
importer.Loaded += OnLoaded;
}
private void OnFileSelected(string path)
{
importer.Import(path);
}
private void OnLoaded(AudioClip clip)
{
audioSource.clip = clip;
audioSource.Play();
}
}