Added .mp3 export (#92)

* Update to larger bitrate

* Add support for sub-voice export

---------

Co-authored-by: katboi01 <59540382+katboi01@users.noreply.github.com>
This commit is contained in:
Evans Jahja
2025-07-20 14:18:58 +09:00
committed by GitHub
parent d48aa4488e
commit 956bbdb6d2
92 changed files with 7741 additions and 57 deletions
+36
View File
@@ -33,6 +33,10 @@ public class UmaViewerBuilder : MonoBehaviour
public List<AudioSource> CurrentAudioSources = new List<AudioSource>();
public List<UmaLyricsData> CurrentLyrics = new List<UmaLyricsData>();
// Used for keeping track for exports
public List<UmaDatabaseEntry> CurrentLiveSoundAWB = new List<UmaDatabaseEntry>();
public int CurrentLiveSoundAWBIndex = -1;
public AnimatorOverrideController OverrideController;
public AnimatorOverrideController FaceOverrideController;
public AnimatorOverrideController CameraOverrideController;
@@ -754,10 +758,13 @@ public class UmaViewerBuilder : MonoBehaviour
//Use decrypt function
public void LoadLiveSound(int songid, UmaDatabaseEntry SongAwb, bool needLyrics = true)
{
CurrentLiveSoundAWBIndex = -1; // mix awb together
CurrentLiveSoundAWB.Clear();
//load character voice
if (SongAwb != null)
{
PlaySound(SongAwb);
CurrentLiveSoundAWB.Add(SongAwb);
}
//load BG
@@ -769,6 +776,7 @@ public class UmaViewerBuilder : MonoBehaviour
if (BGclip.Count > 0)
{
AddAudioSource(BGclip[0]);
CurrentLiveSoundAWB.Add(BGawb);
}
}
@@ -812,6 +820,13 @@ public class UmaViewerBuilder : MonoBehaviour
}
public void SetLastAudio(UmaDatabaseEntry AudioAwb, int index)
{
CurrentLiveSoundAWB.Clear();
CurrentLiveSoundAWB.Add(AudioAwb);
CurrentLiveSoundAWBIndex = index;
}
private void AddAudioSource(AudioClip clip, float volume = 1, bool loop = false)
{
AudioSource source;
@@ -830,6 +845,27 @@ public class UmaViewerBuilder : MonoBehaviour
source.Play();
}
public List<UmaWaveStream> LoadAudioStreams(UmaDatabaseEntry awb)
{
var streams = new List<UmaWaveStream>();
string awbPath = awb.FilePath;
if (!File.Exists(awbPath)) return streams;
FileStream awbFile = File.OpenRead(awbPath);
AwbReader awbReader = new AwbReader(awbFile);
foreach (Wave wave in awbReader.Waves)
{
var stream = new UmaWaveStream(awbReader, wave.WaveId);
streams.Add(stream);
}
return streams;
}
public static List<AudioClip> LoadAudio(UmaDatabaseEntry awb)
{
List<AudioClip> clips = new List<AudioClip>();