示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
     }
 }
示例#3
0
 /// <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);
 }
示例#4
0
 /// <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;
 }
示例#5
0
 /// <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);
 }
示例#6
0
 /// <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);
 }