/// <summary> /// Start Mixer subsystem /// </summary> public static bool Initialize() { Video.Initialize(); //If this is not here, the Mixer will not be properly initialized. if (Sdl.SDL_Init(Sdl.SDL_INIT_AUDIO) != 0) { //throw SdlException.Generate(); return(false); } else { Mixer.OpenInternal(); return(true); } }
/// <summary> /// Start Mixer subsystem /// </summary> public static bool Initialize() { Video.Initialize(); //If this is not here, the Mixer will not be properly initialized. if ((Sdl.SDL_WasInit(Sdl.SDL_INIT_AUDIO)) == (int)SdlFlag.FalseValue) { if (Sdl.SDL_Init(Sdl.SDL_INIT_AUDIO) != (int)SdlFlag.Success) { throw SdlException.Generate(); } Mixer.OpenInternal(); return(true); } else { return(true); } }
/// <summary> /// Loads a music sample from a byte array. /// </summary> /// <param name="data">data buffer</param> public Music(byte[] data) { Mixer.OpenInternal(); this.Handle = Mixer.LoadMusic(data); }
/// <summary> /// Loads a music sample from a file. /// </summary> /// <param name="fileName">The file path to load from.</param> public Music(string fileName) { Mixer.OpenInternal(); this.Handle = Mixer.LoadMusic(fileName); m_FileName = fileName; }
/// <summary> /// Loads sound from a byte array. /// </summary> /// <param name="data">The sound byte information.</param> public Sound(byte[] data) { Mixer.OpenInternal(); this.Handle = Mixer.Load(data, out this.size); }
/// <summary> /// Loads a .wav, .ogg, .mp3, .mod or .mid file into memory. /// </summary> /// <param name="file">The file to load into memory.</param> public Sound(string file) { Mixer.OpenInternal(); this.Handle = Mixer.Load(file, out this.size); }