C# Класс GAudio.GATSampleBank

Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
extraCapacity int

Защищенные свойства (Protected)

Свойство Тип Описание
_allKeys string[]
_allSamples List
_samplesByName GATData>.Dictionary
_soundBank GATSoundBank
_totalCapacity int

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

Метод Описание
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

Защищенные методы

Метод Описание
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

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

AddLoadedFile() публичный Метод

Compatibility with GATAudioLoader.
public AddLoadedFile ( GATData channelsData, string fileName ) : void
channelsData GATData
fileName string
Результат void

AddSample() публичный Метод

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
Результат void

Awake() защищенный Метод

protected Awake ( ) : void
Результат void

ContainsSampleNamed() публичный Метод

Is the specified sample loaded?
public ContainsSampleNamed ( string sampleName ) : bool
sampleName string
Результат bool

EditorUpdateSoundBank() публичный Метод

public EditorUpdateSoundBank ( GATSoundBank bank = null ) : void
bank GATSoundBank
Результат void

FillWithResampledData() защищенный Метод

protected FillWithResampledData ( GATData sourceData, GATData targetData, int fromIndex, int targetLength, double pitch ) : void
sourceData GATData
targetData GATData
fromIndex int
targetLength int
pitch double
Результат void

FillWithResampledData() публичный Метод

public FillWithResampledData ( GATData data, int indexInBank, int fromIndex, int targetLength, double pitch ) : void
data GATData
indexInBank int
fromIndex int
targetLength int
pitch double
Результат void

FillWithResampledData() публичный Метод

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
Результат void

FillWithSampleData() защищенный Метод

protected FillWithSampleData ( GATData sourceData, GATData targetData, int fromIndex, int length ) : void
sourceData GATData
targetData GATData
fromIndex int
length int
Результат void

FillWithSampleData() публичный Метод

public FillWithSampleData ( GATData data, int indexInBank, int fromIndex, int length ) : void
data GATData
indexInBank int
fromIndex int
length int
Результат void

FillWithSampleData() публичный Метод

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
Результат void

GetAudioData() публичный Метод

public GetAudioData ( int indexInBank ) : GATData
indexInBank int
Результат GATData

GetAudioData() публичный Метод

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
Результат GATData

GetClosestSampleForMidiCode() публичный Метод

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.
Результат GATData

InitCollections() защищенный Метод

protected InitCollections ( ) : void
Результат void

LoadAll() публичный Метод

Loads all samples from the referenced SoundBank. Sync operation
public LoadAll ( ) : void
Результат void

LoadSamplesNamed() публичный Метод

Loads specific samples from the referenced Sound Bank. Sync operation.
public LoadSamplesNamed ( List sampleNames ) : void
sampleNames List
Результат void

LoadStreamingAssetsAsync() публичный Метод

Loads specific StreamingAssets samples from the referenced Sound Bank. Async operation.
public LoadStreamingAssetsAsync ( List sampleNames, OperationCompletedHandler onCompleted ) : void
sampleNames List
onCompleted OperationCompletedHandler
Результат void

OnDestroy() защищенный Метод

protected OnDestroy ( ) : void
Результат void

OnEnable() публичный Метод

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

RemoveSample() публичный Метод

Releases a specific sample and it's associated cache.
public RemoveSample ( string sampleName ) : void
sampleName string
Результат void

RemoveSamples() публичный Метод

Releases specific samples and their associated cache.
public RemoveSamples ( List sampleNames ) : void
sampleNames List
Результат void

UnloadAll() публичный Метод

Releases all loaded samples.
public UnloadAll ( ) : void
Результат void

UpdateSoundBank() публичный Метод

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

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

_allKeys защищенное свойство

protected string[] _allKeys
Результат string[]

_allSamples защищенное свойство

protected List _allSamples
Результат List

_samplesByName защищенное свойство

protected Dictionary _samplesByName
Результат GATData>.Dictionary

_soundBank защищенное свойство

protected GATSoundBank _soundBank
Результат GATSoundBank

_totalCapacity защищенное свойство

protected int _totalCapacity
Результат int

extraCapacity публичное свойство

The numer of samples which may be dynamically added to the bank. Not required, used for pooling cache objects at initialization.
public int extraCapacity
Результат int