C# Класс FlatRedBall.Audio.AudioManager

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
GlobalVariables SoundGlobalVariableCollection
SoundListener PositionedSoundListener

Открытые методы

Метод Описание
AddSoundBank ( string soundBankFile ) : void

Adds a sound bank

AddWaveBank ( string waveBankFile ) : void

Adds a wave bank

GetPositionedSound ( String soundName ) : PositionedSound

Gets a positioned sound

GetPositionedSound ( String soundName, string soundBankFile ) : PositionedSound

Gets a positioned sound

GetSound ( String soundName ) : Sound

Gets a sound

GetSound ( String soundName, string soundBankFile ) : Sound

Gets a sound

HasSoundBank ( string soundBankFile ) : bool

Whether or not the given sound bank file has been loaded

HasWaveBank ( string soundBankFile ) : bool

Whether or not the given wave bank file has been loaded

Initialize ( String settingsFile, String waveBankFile, String soundBankFile ) : void

Initializes the audio manager with an XACT audio project

IsSoundEffectPlaying ( SoundEffect soundEffect ) : bool
Play ( SoundEffect soundEffect ) : void
Play ( SoundEffect soundEffect, float volume ) : void

Plays the argument sound effect.

PlayIfNotPlaying ( SoundEffect soundEffect ) : void
PlaySong ( ) : void

Plays the current song. PlaySong with an argument must be called before this can be called. This can be used to resume music when the game is unpaused or if audio options are being turned on/off

PlaySong ( Microsoft.Xna.Framework.Media.Song toPlay, bool forceRestart, bool isSongGlobalContent ) : void

Plays the argument song, optionally restarting it if it is already playing.

PlaySongThenResumeCurrent ( Microsoft.Xna.Framework.Media.Song toPlay, bool songUsesGlobalContent ) : void
PlaySound ( String soundName ) : Cue

Plays a sound immediately

PlaySound ( String soundName, string soundBankFile ) : Cue

Plays a sound immediately

RemovePositionedSound ( PositionedSound sound ) : void

Removes the specified sound from the audio manager Warning: The sound will stop being positioned when removed

RemoveSoundBank ( string soundBankFile ) : void

Removes a sound bank

RemoveWaveBank ( string waveBankFile ) : void

Removes a wave bank

StopAndDisposeCurrentSongIfNameDiffers ( string nameToCompareAgainst ) : bool
StopSong ( ) : void
Update ( ) : void

Приватные методы

Метод Описание
AudioManager ( ) : System
GetCue ( String soundName, string soundBankFile ) : Cue
HandleMediaStateChanged ( object sender, EventArgs e ) : void
OnSuspending ( object sender, EventArgs e ) : void
OnUnsuspending ( object sender, EventArgs e ) : void
UpdateDependencies ( ) : void
UserPermissionCallback ( IAsyncResult r ) : void

Описание методов

AddSoundBank() публичный статический Метод

Adds a sound bank
public static AddSoundBank ( string soundBankFile ) : void
soundBankFile string The sound bank to add
Результат void

AddWaveBank() публичный статический Метод

Adds a wave bank
public static AddWaveBank ( string waveBankFile ) : void
waveBankFile string The wave bank to add
Результат void

GetPositionedSound() публичный статический Метод

Gets a positioned sound
public static GetPositionedSound ( String soundName ) : PositionedSound
soundName String The name of the sound in the XACT project
Результат PositionedSound

GetPositionedSound() публичный статический Метод

Gets a positioned sound
public static GetPositionedSound ( String soundName, string soundBankFile ) : PositionedSound
soundName String The name of the sound in the XACT project
soundBankFile string The name of the sound bank to retrieve the sound from
Результат PositionedSound

GetSound() публичный статический Метод

Gets a sound
public static GetSound ( String soundName ) : Sound
soundName String The name of the sound in the XACT project
Результат Sound

GetSound() публичный статический Метод

Gets a sound
public static GetSound ( String soundName, string soundBankFile ) : Sound
soundName String The name of the sound in the XACT project
soundBankFile string The name of the sound bank to retrieve the sound from
Результат Sound

HasSoundBank() публичный статический Метод

Whether or not the given sound bank file has been loaded
public static HasSoundBank ( string soundBankFile ) : bool
soundBankFile string The sound bank to check
Результат bool

HasWaveBank() публичный статический Метод

Whether or not the given wave bank file has been loaded
public static HasWaveBank ( string soundBankFile ) : bool
soundBankFile string The wave bank to check
Результат bool

Initialize() публичный статический Метод

Initializes the audio manager with an XACT audio project
public static Initialize ( String settingsFile, String waveBankFile, String soundBankFile ) : void
settingsFile String The settings file for the audio project (xgs)
waveBankFile String The wave bank file for the audio project (xwb)
soundBankFile String The sound bank file for the audio project (xsb)
Результат void

IsSoundEffectPlaying() публичный статический Метод

public static IsSoundEffectPlaying ( SoundEffect soundEffect ) : bool
soundEffect Microsoft.Xna.Framework.Audio.SoundEffect
Результат bool

Play() публичный статический Метод

public static Play ( SoundEffect soundEffect ) : void
soundEffect Microsoft.Xna.Framework.Audio.SoundEffect
Результат void

Play() публичный статический Метод

Plays the argument sound effect.
public static Play ( SoundEffect soundEffect, float volume ) : void
soundEffect Microsoft.Xna.Framework.Audio.SoundEffect The sound effect to play
volume float Volume, ranging from 0.0f (silence) to 1.0f (full volume). 1.0f is full volume
Результат void

PlayIfNotPlaying() публичный статический Метод

public static PlayIfNotPlaying ( SoundEffect soundEffect ) : void
soundEffect Microsoft.Xna.Framework.Audio.SoundEffect
Результат void

PlaySong() публичный статический Метод

Plays the current song. PlaySong with an argument must be called before this can be called. This can be used to resume music when the game is unpaused or if audio options are being turned on/off
public static PlaySong ( ) : void
Результат void

PlaySong() публичный статический Метод

Plays the argument song, optionally restarting it if it is already playing.
public static PlaySong ( Microsoft.Xna.Framework.Media.Song toPlay, bool forceRestart, bool isSongGlobalContent ) : void
toPlay Microsoft.Xna.Framework.Media.Song The song to play.
forceRestart bool Whether the song should be restarted. If the toPlay parameter differs from the currently-playing song then it will /// restart regardless of the forceRestart value. This value only matters when the currently-playing song is passed.
isSongGlobalContent bool Whether the song uses a Global content manager. This is important if StopAndDisposeCurrentSongIfNameDiffers is called. /// StopAndDisposeCurrentSongIfNameDiffers is called by Glue, so the isSongGlobalContent param matters even if your code is not directly calling this function.
Результат void

PlaySongThenResumeCurrent() публичный статический Метод

public static PlaySongThenResumeCurrent ( Microsoft.Xna.Framework.Media.Song toPlay, bool songUsesGlobalContent ) : void
toPlay Microsoft.Xna.Framework.Media.Song
songUsesGlobalContent bool
Результат void

PlaySound() публичный статический Метод

Plays a sound immediately
public static PlaySound ( String soundName ) : Cue
soundName String The name of the sound in the XACT project
Результат Microsoft.Xna.Framework.Audio.Cue

PlaySound() публичный статический Метод

Plays a sound immediately
public static PlaySound ( String soundName, string soundBankFile ) : Cue
soundName String The name of the sound in the XACT project
soundBankFile string The name of the sound bank to retrieve the sound from
Результат Microsoft.Xna.Framework.Audio.Cue

RemovePositionedSound() публичный статический Метод

Removes the specified sound from the audio manager Warning: The sound will stop being positioned when removed
public static RemovePositionedSound ( PositionedSound sound ) : void
sound PositionedSound The sound to remove
Результат void

RemoveSoundBank() публичный статический Метод

Removes a sound bank
public static RemoveSoundBank ( string soundBankFile ) : void
soundBankFile string The sound bank to remove
Результат void

RemoveWaveBank() публичный статический Метод

Removes a wave bank
public static RemoveWaveBank ( string waveBankFile ) : void
waveBankFile string The wave bank to remove
Результат void

StopAndDisposeCurrentSongIfNameDiffers() публичный статический Метод

public static StopAndDisposeCurrentSongIfNameDiffers ( string nameToCompareAgainst ) : bool
nameToCompareAgainst string
Результат bool

StopSong() публичный статический Метод

public static StopSong ( ) : void
Результат void

Update() публичный статический Метод

public static Update ( ) : void
Результат void

Описание свойств

GlobalVariables публичное статическое свойство

public static SoundGlobalVariableCollection,FlatRedBall.Audio GlobalVariables
Результат SoundGlobalVariableCollection

SoundListener публичное статическое свойство

public static PositionedSoundListener,FlatRedBall.Audio SoundListener
Результат PositionedSoundListener