bugfixes
This commit is contained in:
43
Runtime/PSXAudioClip.cs
Normal file
43
Runtime/PSXAudioClip.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace SplashEdit.RuntimeCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Pre-converted audio clip data ready for splashpack serialization.
|
||||
/// Populated by the Editor (PSXSceneExporter) so Runtime code never
|
||||
/// touches PSXAudioConverter.
|
||||
/// </summary>
|
||||
public struct AudioClipExport
|
||||
{
|
||||
public byte[] adpcmData;
|
||||
public int sampleRate;
|
||||
public bool loop;
|
||||
public string clipName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
[AddComponentMenu("PSX/Audio Clip")]
|
||||
public class PSXAudioClip : 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user