public static float[] CreateRangedRawData(
     string path,
     int wavBufIndex,
     int samples,
     int channels,
     int bitPerSample)
 {
     byte[] data = File.ReadAllBytes(path);
     return(data.Length == 0 ? (float[])null : ExternalAudioClip.CreateRangedRawData(data, wavBufIndex, samples, channels, bitPerSample));
 }
    public static AudioClip Load(
        string path,
        long SongLength,
        uAudio.uAudio_backend.uAudio uAudio,
        ref string szErrorMs)
    {
        string extension = Path.GetExtension(path);

        if (extension == ".wav" || extension == ".WAV")
        {
            WaveHeader waveHeader    = WaveHeader.ReadWaveHeader(path);
            float[]    rangedRawData = ExternalAudioClip.CreateRangedRawData(path, waveHeader.TrueWavBufIndex, waveHeader.TrueSamples, (int)waveHeader.Channels, (int)waveHeader.BitPerSample);
            return(rangedRawData.Length == 0 ? (AudioClip)null : ExternalAudioClip.CreateClip(Path.GetFileNameWithoutExtension(path), rangedRawData, waveHeader.TrueSamples, (int)waveHeader.Channels, waveHeader.Frequency));
        }
        if (!(extension == ".mp3") && !(extension == ".MP3"))
        {
            return((AudioClip)null);
        }
        mp3AudioClip._uAudio = uAudio;
        AudioClip audioClip = mp3AudioClip.LoadMp3(path, SongLength);

        szErrorMs = mp3AudioClip.szErrorMs;
        return(audioClip);
    }