C# 클래스 flxSharp.flxSharp.FlxSound

This is the universal flixel sound object, used for streaming, music, and sound effects. For all the pan stuff http://allcomputers.us/windows_phone/xna-game-studio-4_0---playing-sound-effects-(part-1)---using-soundeffect-for-audio-playback.aspx TODO: Implement overloaded functionality for Sound (mp3 files) all over the place...
상속: FlxBasic
파일 보기 프로젝트 열기: jlorek/flxSharp

공개 프로퍼티들

프로퍼티 타입 설명
amplitude float
amplitudeLeft float
amplitudeRight float
artist string
autoDestroy bool
name string
survive bool
x float
y float

보호된 프로퍼티들

프로퍼티 타입 설명
_fadeInTimer float
_fadeInTotal float
_fadeOutTimer float
_fadeOutTotal float
_looped bool
_pan bool
_pauseOnFadeOut bool
_position float
_radius float
_sound Microsoft.Xna.Framework.Audio.SoundEffectInstance
_target FlxObject
_volume float
_volumeAdjust float

공개 메소드들

메소드 설명
FlxSound ( ) : System

The FlxSound constructor gets all the variables initialized, but NOT ready to play a sound yet.

destroy ( ) : void

Clean up memory.

fadeIn ( float seconds ) : void

Call this function to make a sound fade in over a certain time interval (calls play() automatically).

fadeOut ( float seconds, bool pauseInstead = false ) : void

Call this function to make this sound fade out over a certain time interval.

getActualVolume ( ) : float

Returns the currently selected "real" volume of the sound (takes fades and proximity into account).

kill ( ) : void
loadEmbedded ( SoundEffect embeddedSound, bool looped = false, bool autoDestroy = false ) : FlxSound

One of two main setup functions for sounds, this function loads a sound from an embedded MP3.

loadStream ( string soundUrl, bool looped = false, bool autoDestroy = false ) : FlxSound

One of two main setup functions for sounds, this function loads a sound from a URL.

pause ( ) : void

Call this function to pause this sound.

play ( bool forceRestart = false ) : void

Call this function to play the sound - also works on paused sounds.

proximity ( float x, float y, FlxObject target, float radius, bool pan = true ) : FlxSound

Call this function if you want this sound's volume to change based on distance from a particular FlxCore object.

resume ( ) : void

Unpause a sound. Only works on sounds that have been paused.

stop ( ) : void

Call this function to stop this sound.

update ( ) : void

Handles fade out, fade in, panning, proximity, and amplitude operations each frame.

보호된 메소드들

메소드 설명
createSound ( ) : void

An internal function for clearing all the variables used by sounds.

비공개 메소드들

메소드 설명
updateTransform ( ) : void

Call after adjusting the volume to update the sound channel's settings.

메소드 상세

FlxSound() 공개 메소드

The FlxSound constructor gets all the variables initialized, but NOT ready to play a sound yet.
public FlxSound ( ) : System
리턴 System

createSound() 보호된 메소드

An internal function for clearing all the variables used by sounds.
protected createSound ( ) : void
리턴 void

destroy() 공개 메소드

Clean up memory.
public destroy ( ) : void
리턴 void

fadeIn() 공개 메소드

Call this function to make a sound fade in over a certain time interval (calls play() automatically).
public fadeIn ( float seconds ) : void
seconds float The amount of time the fade-in operation should take.
리턴 void

fadeOut() 공개 메소드

Call this function to make this sound fade out over a certain time interval.
public fadeOut ( float seconds, bool pauseInstead = false ) : void
seconds float The amount of time the fade out operation should take.
pauseInstead bool Tells the sound to pause on fadeout, instead of stopping.
리턴 void

getActualVolume() 공개 메소드

Returns the currently selected "real" volume of the sound (takes fades and proximity into account).
public getActualVolume ( ) : float
리턴 float

kill() 공개 메소드

public kill ( ) : void
리턴 void

loadEmbedded() 공개 메소드

One of two main setup functions for sounds, this function loads a sound from an embedded MP3.
public loadEmbedded ( SoundEffect embeddedSound, bool looped = false, bool autoDestroy = false ) : FlxSound
embeddedSound Microsoft.Xna.Framework.Audio.SoundEffect An embedded Class object representing an MP3 file.
looped bool Whether or not this sound should loop endlessly.
autoDestroy bool Whether or not this FlxSound instance should be destroyed when the sound finishes playing. Default value is false, but FlxG.play() and FlxG.stream() will set it to true by default.
리턴 FlxSound

loadStream() 공개 메소드

One of two main setup functions for sounds, this function loads a sound from a URL.
public loadStream ( string soundUrl, bool looped = false, bool autoDestroy = false ) : FlxSound
soundUrl string A string representing the URL of the MP3 file you want to play.
looped bool Whether or not this sound should loop endlessly.
autoDestroy bool Whether or not this FlxSound instance should be destroyed when the sound finishes playing. Default value is false, but FlxG.play() and FlxG.stream() will set it to true by default.
리턴 FlxSound

pause() 공개 메소드

Call this function to pause this sound.
public pause ( ) : void
리턴 void

play() 공개 메소드

Call this function to play the sound - also works on paused sounds.
public play ( bool forceRestart = false ) : void
forceRestart bool Whether to start the sound over or not. Default value is false, meaning if the sound is already playing or was paused when you call play(), it will continue playing from its current position, NOT start again from the beginning.
리턴 void

proximity() 공개 메소드

Call this function if you want this sound's volume to change based on distance from a particular FlxCore object.
public proximity ( float x, float y, FlxObject target, float radius, bool pan = true ) : FlxSound
x float The X position of the sound.
y float The Y position of the sound.
target FlxObject The object you want to track.
radius float The maximum distance this sound can travel.
pan bool Whether the sound should pan in addition to the volume changes (default: true).
리턴 FlxSound

resume() 공개 메소드

Unpause a sound. Only works on sounds that have been paused.
public resume ( ) : void
리턴 void

stop() 공개 메소드

Call this function to stop this sound.
public stop ( ) : void
리턴 void

update() 공개 메소드

Handles fade out, fade in, panning, proximity, and amplitude operations each frame.
public update ( ) : void
리턴 void

프로퍼티 상세

_fadeInTimer 보호되어 있는 프로퍼티

Internal timer for fading in the sound playback.
protected float _fadeInTimer
리턴 float

_fadeInTotal 보호되어 있는 프로퍼티

Internal helper for fading in sounds.
protected float _fadeInTotal
리턴 float

_fadeOutTimer 보호되어 있는 프로퍼티

Internal timer used to keep track of requests to fade out the sound playback.
protected float _fadeOutTimer
리턴 float

_fadeOutTotal 보호되어 있는 프로퍼티

Internal helper for fading out sounds.
protected float _fadeOutTotal
리턴 float

_looped 보호되어 있는 프로퍼티

Internal tracker for whether the sound is looping or not.
protected bool _looped
리턴 bool

_pan 보호되어 있는 프로퍼티

Internal tracker for whether to pan the sound left and right. Default is false.
protected bool _pan
리턴 bool

_pauseOnFadeOut 보호되어 있는 프로퍼티

Internal flag for whether to pause or stop the sound when it's done fading out.
protected bool _pauseOnFadeOut
리턴 bool

_position 보호되어 있는 프로퍼티

Internal tracker for the position in runtime of the music playback.
protected float _position
리턴 float

_radius 보호되어 있는 프로퍼티

Internal tracker for the maximum effective radius of this sound (for proximity and panning).
protected float _radius
리턴 float

_sound 보호되어 있는 프로퍼티

Internal tracker for a XNA sound object.
protected SoundEffectInstance,Microsoft.Xna.Framework.Audio _sound
리턴 Microsoft.Xna.Framework.Audio.SoundEffectInstance

_target 보호되어 있는 프로퍼티

Internal tracker for the sound's "target" (for proximity and panning).
protected FlxObject,flxSharp.flxSharp _target
리턴 FlxObject

_volume 보호되어 있는 프로퍼티

Internal tracker for how loud the sound is.
protected float _volume
리턴 float

_volumeAdjust 보호되어 있는 프로퍼티

Internal tracker for total volume adjustment.
protected float _volumeAdjust
리턴 float

amplitude 공개적으로 프로퍼티

Stores the average wave amplitude of both stereo channels.
public float amplitude
리턴 float

amplitudeLeft 공개적으로 프로퍼티

Just the amplitude of the left stereo channel.
public float amplitudeLeft
리턴 float

amplitudeRight 공개적으로 프로퍼티

Just the amplitude of the right stereo channel.
public float amplitudeRight
리턴 float

artist 공개적으로 프로퍼티

The ID3 artist name. Defaults to null. Currently only works for streamed sounds.
public string artist
리턴 string

autoDestroy 공개적으로 프로퍼티

Whether to call destroy() when the sound has finished.
public bool autoDestroy
리턴 bool

name 공개적으로 프로퍼티

The ID3 song name. Defaults to null. Currently only works for streamed sounds.
public string name
리턴 string

survive 공개적으로 프로퍼티

Whether or not this sound should be automatically destroyed when you switch states.
public bool survive
리턴 bool

x 공개적으로 프로퍼티

The X position of this sound in world coordinates. Only really matters if you are doing proximity/panning stuff.
public float x
리턴 float

y 공개적으로 프로퍼티

The Y position of this sound in world coordinates. Only really matters if you are doing proximity/panning stuff.
public float y
리턴 float