Skip to content

Instantly share code, notes, and snippets.

@asus4
Created November 30, 2023 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asus4/4acd2b0dcf4c2a577523088001cb6625 to your computer and use it in GitHub Desktop.
Save asus4/4acd2b0dcf4c2a577523088001cb6625 to your computer and use it in GitHub Desktop.
List All Reverb Preset Parameters
using System;
using System.Text;
using UnityEngine;
public class ListAllReverbPresetSettings : MonoBehaviour
{
[SerializeField]
AudioReverbFilter filter;
private void Start()
{
var sb = new StringBuilder();
foreach (AudioReverbPreset preset in Enum.GetValues(typeof(AudioReverbPreset)))
{
ParseAllProperties(filter, preset, sb);
}
Debug.Log(sb);
}
private static void ParseAllProperties(AudioReverbFilter filter, AudioReverbPreset preset, StringBuilder sb)
{
filter.reverbPreset = preset;
sb.AppendLine($"### {preset}");
sb.AppendLine();
sb.AppendLine("| Property | Value |");
sb.AppendLine("| --- | --- |");
/*
Parse following properties:
Dry Level
Room
Room HF
Decay Time
Decay HF Ratio
Reflections
Reflect Delay
Reverb
Reverb Delay
Diffusion
Density
HFReference
Room LF
LFReference
*/
static string CustomFormat(float value) =>
value.ToString("G5");
sb.AppendLine($"| Dry Level | {CustomFormat(filter.dryLevel)} |");
sb.AppendLine($"| Room | {CustomFormat(filter.room)} |");
sb.AppendLine($"| Room HF | {CustomFormat(filter.roomHF)} |");
sb.AppendLine($"| Decay Time | {CustomFormat(filter.decayTime)} |");
sb.AppendLine($"| Decay HF Ratio | {CustomFormat(filter.decayHFRatio)} |");
sb.AppendLine($"| Reflections | {CustomFormat(filter.reflectionsLevel)} |");
sb.AppendLine($"| Reflect Delay | {CustomFormat(filter.reflectionsDelay)} |");
sb.AppendLine($"| Reverb | {CustomFormat(filter.reverbLevel)} |");
sb.AppendLine($"| Reverb Delay | {CustomFormat(filter.reverbDelay)} |");
sb.AppendLine($"| Diffusion | {CustomFormat(filter.diffusion)} |");
sb.AppendLine($"| Density | {CustomFormat(filter.density)} |");
sb.AppendLine($"| HFReference | {CustomFormat(filter.hfReference)} |");
sb.AppendLine($"| Room LF | {CustomFormat(filter.roomLF)} |");
sb.AppendLine($"| LFReference | {CustomFormat(filter.lfReference)} |");
sb.AppendLine();
sb.AppendLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment