UnityEditor.AudioUtil.GetWaveForm C# (CSharp) Method

GetWaveForm() private method

private GetWaveForm ( AudioClip clip, AssetImporter importer, int channel, float width, float height ) : Texture2D
clip UnityEngine.AudioClip
importer AssetImporter
channel int
width float
height float
return UnityEngine.Texture2D
        public static extern Texture2D GetWaveForm(AudioClip clip, AssetImporter importer, int channel, float width, float height);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]

Usage Example

        public override Texture2D RenderStaticPreview(string assetPath, UnityEngine.Object[] subAssets, int width, int height)
        {
            AssetImporter atPath = AssetImporter.GetAtPath(assetPath);
            AudioImporter exists = atPath as AudioImporter;

            if (!exists)
            {
                return(null);
            }
            AudioClip audioClip = this.target as AudioClip;

            Texture2D[] array = new Texture2D[audioClip.channels];
            for (int i = 0; i < audioClip.channels; i++)
            {
                array[i] = AudioUtil.GetWaveForm(audioClip, atPath, i, (float)width, (float)(height / audioClip.channels));
            }
            return(AudioClipInspector.CombineWaveForms(array));
        }
All Usage Examples Of UnityEditor.AudioUtil::GetWaveForm