C# Class GAudio.GATSampleBank

Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: gregzo/G-Audio Class Usage Examples

Méthodes publiques

Свойство Type Description
extraCapacity int

Protected Properties

Свойство Type Description
_allKeys string[]
_allSamples List
_samplesByName GATData>.Dictionary
_soundBank GATSoundBank
_totalCapacity int

Méthodes publiques

Méthode Description
AddLoadedFile ( GATData channelsData, string fileName ) : void

Compatibility with GATAudioLoader.

AddSample ( GATData data, string sampleName ) : void

Adds a sample to the bank, which will retain it, and manage cache for it if GATActiveSamplebank.

ContainsSampleNamed ( string sampleName ) : bool

Is the specified sample loaded?

EditorUpdateSoundBank ( GATSoundBank bank = null ) : void
FillWithResampledData ( GATData data, int indexInBank, int fromIndex, int targetLength, double pitch ) : void
FillWithResampledData ( GATData data, string sampleName, int fromIndex, int targetLength, double pitch ) : void

Convenience method for copying a resampled chunk of a sample to a GATData container. Target length is the requested ouptut length.

FillWithSampleData ( GATData data, int indexInBank, int fromIndex, int length ) : void
FillWithSampleData ( GATData data, string sampleName, int fromIndex, int length ) : void

Convenience method for copying a chunk of a sample to a GATData container.

GetAudioData ( int indexInBank ) : GATData
GetAudioData ( string sampleName ) : GATData

Grabs a reference to the samples data. Note that changes to the data will be persistent until the bank is reloaded.

GetClosestSampleForMidiCode ( float midiCode, float &pitchShift ) : GATData

Returns the sample closest to the provided midicode and a pitch shift value to be applied to the sample

LoadAll ( ) : void

Loads all samples from the referenced SoundBank. Sync operation

LoadSamplesNamed ( List sampleNames ) : void

Loads specific samples from the referenced Sound Bank. Sync operation.

LoadStreamingAssetsAsync ( List sampleNames, OperationCompletedHandler onCompleted ) : void

Loads specific StreamingAssets samples from the referenced Sound Bank. Async operation.

OnEnable ( ) : void
RemoveSample ( string sampleName ) : void

Releases a specific sample and it's associated cache.

RemoveSamples ( List sampleNames ) : void

Releases specific samples and their associated cache.

UnloadAll ( ) : void

Releases all loaded samples.

UpdateSoundBank ( ) : void

Méthodes protégées

Méthode Description
Awake ( ) : void
FillWithResampledData ( GATData sourceData, GATData targetData, int fromIndex, int targetLength, double pitch ) : void
FillWithSampleData ( GATData sourceData, GATData targetData, int fromIndex, int length ) : void
InitCollections ( ) : void
OnDestroy ( ) : void

Method Details

AddLoadedFile() public méthode

Compatibility with GATAudioLoader.
public AddLoadedFile ( GATData channelsData, string fileName ) : void
channelsData GATData
fileName string
Résultat void

AddSample() public méthode

Adds a sample to the bank, which will retain it, and manage cache for it if GATActiveSamplebank.
public AddSample ( GATData data, string sampleName ) : void
data GATData
sampleName string
Résultat void

Awake() protected méthode

protected Awake ( ) : void
Résultat void

ContainsSampleNamed() public méthode

Is the specified sample loaded?
public ContainsSampleNamed ( string sampleName ) : bool
sampleName string
Résultat bool

EditorUpdateSoundBank() public méthode

public EditorUpdateSoundBank ( GATSoundBank bank = null ) : void
bank GATSoundBank
Résultat void

FillWithResampledData() protected méthode

protected FillWithResampledData ( GATData sourceData, GATData targetData, int fromIndex, int targetLength, double pitch ) : void
sourceData GATData
targetData GATData
fromIndex int
targetLength int
pitch double
Résultat void

FillWithResampledData() public méthode

public FillWithResampledData ( GATData data, int indexInBank, int fromIndex, int targetLength, double pitch ) : void
data GATData
indexInBank int
fromIndex int
targetLength int
pitch double
Résultat void

FillWithResampledData() public méthode

Convenience method for copying a resampled chunk of a sample to a GATData container. Target length is the requested ouptut length.
public FillWithResampledData ( GATData data, string sampleName, int fromIndex, int targetLength, double pitch ) : void
data GATData
sampleName string
fromIndex int
targetLength int
pitch double
Résultat void

FillWithSampleData() protected méthode

protected FillWithSampleData ( GATData sourceData, GATData targetData, int fromIndex, int length ) : void
sourceData GATData
targetData GATData
fromIndex int
length int
Résultat void

FillWithSampleData() public méthode

public FillWithSampleData ( GATData data, int indexInBank, int fromIndex, int length ) : void
data GATData
indexInBank int
fromIndex int
length int
Résultat void

FillWithSampleData() public méthode

Convenience method for copying a chunk of a sample to a GATData container.
public FillWithSampleData ( GATData data, string sampleName, int fromIndex, int length ) : void
data GATData
sampleName string
fromIndex int
length int
Résultat void

GetAudioData() public méthode

public GetAudioData ( int indexInBank ) : GATData
indexInBank int
Résultat GATData

GetAudioData() public méthode

Grabs a reference to the samples data. Note that changes to the data will be persistent until the bank is reloaded.
public GetAudioData ( string sampleName ) : GATData
sampleName string
Résultat GATData

GetClosestSampleForMidiCode() public méthode

Returns the sample closest to the provided midicode and a pitch shift value to be applied to the sample
public GetClosestSampleForMidiCode ( float midiCode, float &pitchShift ) : GATData
midiCode float Midi code.
pitchShift float Pitch shift.
Résultat GATData

InitCollections() protected méthode

protected InitCollections ( ) : void
Résultat void

LoadAll() public méthode

Loads all samples from the referenced SoundBank. Sync operation
public LoadAll ( ) : void
Résultat void

LoadSamplesNamed() public méthode

Loads specific samples from the referenced Sound Bank. Sync operation.
public LoadSamplesNamed ( List sampleNames ) : void
sampleNames List
Résultat void

LoadStreamingAssetsAsync() public méthode

Loads specific StreamingAssets samples from the referenced Sound Bank. Async operation.
public LoadStreamingAssetsAsync ( List sampleNames, OperationCompletedHandler onCompleted ) : void
sampleNames List
onCompleted OperationCompletedHandler
Résultat void

OnDestroy() protected méthode

protected OnDestroy ( ) : void
Résultat void

OnEnable() public méthode

public OnEnable ( ) : void
Résultat void

RemoveSample() public méthode

Releases a specific sample and it's associated cache.
public RemoveSample ( string sampleName ) : void
sampleName string
Résultat void

RemoveSamples() public méthode

Releases specific samples and their associated cache.
public RemoveSamples ( List sampleNames ) : void
sampleNames List
Résultat void

UnloadAll() public méthode

Releases all loaded samples.
public UnloadAll ( ) : void
Résultat void

UpdateSoundBank() public méthode

public UpdateSoundBank ( ) : void
Résultat void

Property Details

_allKeys protected_oe property

protected string[] _allKeys
Résultat string[]

_allSamples protected_oe property

protected List _allSamples
Résultat List

_samplesByName protected_oe property

protected Dictionary _samplesByName
Résultat GATData>.Dictionary

_soundBank protected_oe property

protected GATSoundBank _soundBank
Résultat GATSoundBank

_totalCapacity protected_oe property

protected int _totalCapacity
Résultat int

extraCapacity public_oe property

The numer of samples which may be dynamically added to the bank. Not required, used for pooling cache objects at initialization.
public int extraCapacity
Résultat int