public unsafe void FillFrom(AudioPackage source) { Debug.Assert(source.Count == Count); Debug.Assert(ReferenceEquals(source.lookup, lookup)); source.FillSoundEffectArray(sounds); }
public static SoundBank CreateEmpty(AudioPackage input) { // IMPORTANT: The sound bank is definition data. We must return the same result no matter whether or not we have an audio device! // (SafeSoundEffect serializes as reference only, so we don't need to care about its contents.) SoundBank result; result.lookup = input.lookup; result.sounds = new SafeSoundEffect[input.Count]; for (int i = 0; i < result.sounds.Length; i++) { result.sounds[i] = new SafeSoundEffect(); } return(result); }