private AudioClipAssetData CreateAudioAsset(Apk apk, string levelID) { string audioClipFile = Path.Combine(levelFolderPath, _songFilename); string sourceFileName = levelID + ".ogg"; if (apk != null) { apk.CopyFileInto(audioClipFile, $"assets/bin/Data/{sourceFileName}"); } ulong fileSize = (ulong)new FileInfo(audioClipFile).Length; NVorbis.VorbisReader v = new NVorbis.VorbisReader(audioClipFile); return(new AudioClipAssetData() { name = levelID, loadType = 1, channels = v.Channels, frequency = v.SampleRate, bitsPerSample = 16, length = (Single)v.TotalTime.TotalSeconds, isTracker = false, subsoundIndex = 0, preloadAudio = false, backgroundLoad = true, legacy3D = true, compressionFormat = 1, // vorbis source = sourceFileName, offset = 0, size = fileSize, }); }
public void ApplyTo(Apk apk) { foreach (var copy in copies) { apk.CopyFileInto(copy.Item1, copy.Item2); } foreach (string item in deletions) { apk.RemoveFileAt(item); } }