using UnityEngine; namespace SplashEdit.RuntimeCode { /// /// Pre-converted audio clip data ready for splashpack serialization. /// Populated by the Editor (PSXSceneExporter) so Runtime code never /// touches PSXAudioConverter. /// public struct AudioClipExport { public byte[] adpcmData; public int sampleRate; public bool loop; public string clipName; } /// /// Attach to a GameObject to include an audio clip in the PS1 build. /// At export time, the AudioClip is converted to SPU ADPCM and packed /// into the splashpack binary. Use Audio.Play(clipIndex) from Lua. /// [AddComponentMenu("PSX/Audio Source")] public class PSXAudioSource : MonoBehaviour { [Tooltip("Name used to identify this clip in Lua (Audio.Play(\"name\"))." )] public string ClipName = ""; [Tooltip("Unity AudioClip to convert to PS1 SPU ADPCM format.")] public AudioClip Clip; [Tooltip("Target sample rate for the PS1 (lower = smaller, max 44100).")] [Range(8000, 44100)] public int SampleRate = 22050; [Tooltip("Whether this clip should loop when played.")] public bool Loop = false; [Tooltip("Default playback volume (0-127).")] [Range(0, 127)] public int DefaultVolume = 100; } }