C# Класс GAudio.GATData

A wrapper for audio data, with a suite of audio processing methods. Used throughout G-Audio. Note: When requesting GATData instances from GATManager.GetDataContainer( int size ), you will in fact be handed an instance of a managed subclass ( GATDataAllocator.GATManagedData ) which responds to Retain() and Release() calls. See the example scenes that comes with G-Audio for examples of typical use.
Наследование: RetainableObject, IGATDataOwner
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
_offset int
_parentArray float[]

Private Properties

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

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

Метод Описание
ApplyFilter ( AGATFilter filter, int fromIndex, int length, bool emptyData ) : void

Applies a filter to the instance's audio data.

CheckSampleBounds ( ) : bool

Checks that no data exceeds the -1f to 1f range.

Clear ( ) : void

Clears all audio data

Clear ( int fromIndex, int length ) : void

Clears audio data at specified range

ClearInterlaced ( int channelNb, int nbOfInterlacedChannels, int length ) : void

Clears a specific channel of interleaved data

ConvertAndSetInt16 ( System source, int sourceOffset, int targetOffset, int length ) : void

Converts an Int16 array and set it at targetOffset

CopyFrom ( float sourceArray, int destinationIndex, int sourceIndex, int length ) : void

Copies data from a float[] to a GATData instance.

CopyFromInterlaced ( float sourceArray, int targetLength, int channelNb, int nbOfChannels ) : void

Performs a copy of a single channel from an interlaced source array.

CopyFromInterlaced ( float sourceArray, int targetLength, int targetOffset, int channelNb, int nbOfChannels ) : void

Performs a copy of a single channel from an interlaced source array.

CopyFromInterlaced ( float sourceArray, int sourceOffset, int targetLength, int targetOffset, int channelNb, int nbOfChannels ) : void

Performs a copy of a single channel from an interlaced source array. sourceOffset is samples offset for channel 0.

CopyGainTo ( GATData destinationData, int sourceIndex, int destinationIndex, int length, float gain ) : void

Copies and multuplies by gain data from one GATData instance to another.

CopySmoothedGainFrom ( float sourceArray, int sourceIndex, int destinationIndex, int length, float fromGain, float toGain ) : void

Copies data from a float[] to a GATData instance and applies interpolated gain.

CopySmoothedGainTo ( int sourceIndex, GATData destination, int destinationIndex, int length, float fromGain, float toGain ) : void

Copies data from a GATData instance to another and applies interpolated gain.

CopyTo ( GATData destinationData, int destinationIndex, int sourceIndex, int length ) : void

Copies data from a GATData instance to another.

CopyTo ( float destinationArray, int destinationIndex, int sourceIndex, int length ) : void

Copies data from a GATData instance to a float array.

CopyToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, int channelNb ) : void

Copy to an interleaved float[]

Fade ( float fromGain, float toGain, int fadeLength, int offset ) : void
FadeIn ( int fadeLength ) : void

In place fade-in from offset 0 to fadeLength

FadeInSquared ( int fadeLength ) : void
FadeOut ( int fadeLength ) : void

In-place fade-out from offset this.Count - fadeLength to this.Count - 1

FadeOut ( int offset, int fadeLength ) : void

In-place fade out with offset control

FadeOutSquared ( int fadeLength ) : void
GATData ( float parentArray ) : System

Initializes a new instance of the GATData class. If you need a managed data chunk, use GATManager.GetDataContainer instead

Gain ( int fromIndex, int length, float gain ) : void
GainCopyToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATChannelGain channelGain ) : void

Copy and gain to an interleaved float[]

GainMixTo ( GATData destinationData, int sourceIndex, int destinationIndex, int length, float gain ) : void

Additive copy and gain to another GATData instance

GainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATChannelGain channelGain ) : void

Additive copy and gain to an interleaved float[]

GainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATChannelGain channelGain, float igain ) : void

Additive copy and gain to an interleaved float[] with extra gain parameter.

GetPointer ( ) : IntPtr

Gets an IntPtr pointer to the parent array. Only valid for GATData instances obtained through GATManager.GetDataContainer calls.

GlissCopyFrom ( GATData sourceData, int fromIndex, double fromPitch, double toPitch ) : void
GlissCopyFrom ( float sourceArray, int fromIndex, int targetLength, double fromPitch, double toPitch ) : void
MixFrom ( float sourceArray, int destinationIndex, int sourceIndex, int length ) : void

Additive copy from a float[]

MixFromInterlaced ( float sourceArray, int sourceFrameOffset, int targetLength, int targetOffset, int channelNb, int nbOfChannels ) : void

Performs a copy of a single channel from an interlaced source array.

MixSmoothedGainFrom ( float sourceArray, int sourceIndex, int destinationIndex, int length, float fromGain, float toGain ) : void

Additive copy and interpolated gain from a float[]

MixSmoothedGainTo ( int sourceIndex, GATData destination, int destinationIndex, int length, float fromGain, float toGain ) : void

Additive copy and interpolated gain to another GATData instance

MixTo ( GATData destination, int destinationIndex, int sourceIndex, int length ) : void

Additive copy to another GATData instance

MixTo ( float destinationArray, int destinationIndex, int sourceIndex, int length ) : void

Additive copy to a float[]

NextZeroCrossing ( int fromIndex, bool &positive ) : int

Finds the next zero crossing.

Normalize ( float normalizedMax ) : void

Applies gain to the instance's data so that the maximum value matches normalizedMax

ResampleCopyFrom ( float sourceArray, double trueInterpolatedIndex, int targetLength, int targetOffset, double resamplingFactor ) : double

Performs a resampled copy from an array to the GATData instance it is called on. The resampling algorithm performs naive linear interpolation.

ResampleCopyTo ( double trueInterpolatedIndex, GATData destinationSample, int targetLength, double resamplingFactor ) : double

Performs a resampled copy to another GATData instance. The resampling algorithm performs naive linear interpolation.

ResampleCopyTo ( int sourceIndex, GATData destinationSample, int targetLength, double resamplingFactor ) : void

Performs a resampled copy to another GATData instance The resampling algorithm performs naive linear interpolation. Warning: for resampling in chunks, use the method of the same name which returns a double interpolated index.

Reverse ( ) : void

Reverses the entire audio data.

Reverse ( int offset, int length ) : void
SmoothedGain ( int fromIndex, int length, float fromGain, float toGain ) : void

In-place Interpolated gain

SmoothedGainCopyToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATDynamicChannelGain channelGain ) : void

Copy and interpolated gain to an interleaved float[]

SmoothedGainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATDynamicChannelGain channelGain ) : void

Additive copy and interpolated gain to an interleaved float[]

SmoothedGainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATDynamicChannelGain channelGain, float igain ) : void

Additive copy and interpolated gain to an interleaved float[] with extra gain parameter

this ( int index ) : float

Gets or sets the float in the parent array at the specified index. The indexer should only be used for quick prototyping, as it is roughly 30% slower than caching ParentArray for direct access in an extension method.

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

Метод Описание
Discard ( ) : void

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

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

Applies a filter to the instance's audio data.
public ApplyFilter ( AGATFilter filter, int fromIndex, int length, bool emptyData ) : void
filter AGATFilter
fromIndex int
length int
emptyData bool
Результат void

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

Checks that no data exceeds the -1f to 1f range.
public CheckSampleBounds ( ) : bool
Результат bool

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

Clears all audio data
public Clear ( ) : void
Результат void

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

Clears audio data at specified range
public Clear ( int fromIndex, int length ) : void
fromIndex int
length int
Результат void

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

Clears a specific channel of interleaved data
public ClearInterlaced ( int channelNb, int nbOfInterlacedChannels, int length ) : void
channelNb int
nbOfInterlacedChannels int
length int
Результат void

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

Converts an Int16 array and set it at targetOffset
public ConvertAndSetInt16 ( System source, int sourceOffset, int targetOffset, int length ) : void
source System
sourceOffset int
targetOffset int
length int
Результат void

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

Copies data from a float[] to a GATData instance.
public CopyFrom ( float sourceArray, int destinationIndex, int sourceIndex, int length ) : void
sourceArray float
destinationIndex int
sourceIndex int
length int
Результат void

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

Performs a copy of a single channel from an interlaced source array.
public CopyFromInterlaced ( float sourceArray, int targetLength, int channelNb, int nbOfChannels ) : void
sourceArray float
targetLength int
channelNb int
nbOfChannels int
Результат void

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

Performs a copy of a single channel from an interlaced source array.
public CopyFromInterlaced ( float sourceArray, int targetLength, int targetOffset, int channelNb, int nbOfChannels ) : void
sourceArray float
targetLength int
targetOffset int
channelNb int
nbOfChannels int
Результат void

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

Performs a copy of a single channel from an interlaced source array. sourceOffset is samples offset for channel 0.
public CopyFromInterlaced ( float sourceArray, int sourceOffset, int targetLength, int targetOffset, int channelNb, int nbOfChannels ) : void
sourceArray float
sourceOffset int
targetLength int
targetOffset int
channelNb int
nbOfChannels int
Результат void

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

Copies and multuplies by gain data from one GATData instance to another.
public CopyGainTo ( GATData destinationData, int sourceIndex, int destinationIndex, int length, float gain ) : void
destinationData GATData
sourceIndex int
destinationIndex int
length int
gain float
Результат void

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

Copies data from a float[] to a GATData instance and applies interpolated gain.
public CopySmoothedGainFrom ( float sourceArray, int sourceIndex, int destinationIndex, int length, float fromGain, float toGain ) : void
sourceArray float
sourceIndex int
destinationIndex int
length int
fromGain float
toGain float
Результат void

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

Copies data from a GATData instance to another and applies interpolated gain.
public CopySmoothedGainTo ( int sourceIndex, GATData destination, int destinationIndex, int length, float fromGain, float toGain ) : void
sourceIndex int
destination GATData
destinationIndex int
length int
fromGain float
toGain float
Результат void

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

Copies data from a GATData instance to another.
public CopyTo ( GATData destinationData, int destinationIndex, int sourceIndex, int length ) : void
destinationData GATData
destinationIndex int
sourceIndex int
length int
Результат void

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

Copies data from a GATData instance to a float array.
public CopyTo ( float destinationArray, int destinationIndex, int sourceIndex, int length ) : void
destinationArray float
destinationIndex int
sourceIndex int
length int
Результат void

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

Copy to an interleaved float[]
public CopyToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, int channelNb ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelNb int
Результат void

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

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

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

public Fade ( float fromGain, float toGain, int fadeLength, int offset ) : void
fromGain float
toGain float
fadeLength int
offset int
Результат void

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

In place fade-in from offset 0 to fadeLength
public FadeIn ( int fadeLength ) : void
fadeLength int
Результат void

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

public FadeInSquared ( int fadeLength ) : void
fadeLength int
Результат void

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

In-place fade-out from offset this.Count - fadeLength to this.Count - 1
public FadeOut ( int fadeLength ) : void
fadeLength int
Результат void

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

In-place fade out with offset control
public FadeOut ( int offset, int fadeLength ) : void
offset int
fadeLength int
Результат void

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

public FadeOutSquared ( int fadeLength ) : void
fadeLength int
Результат void

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

Initializes a new instance of the GATData class. If you need a managed data chunk, use GATManager.GetDataContainer instead
public GATData ( float parentArray ) : System
parentArray float
Результат System

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

public Gain ( int fromIndex, int length, float gain ) : void
fromIndex int
length int
gain float
Результат void

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

Copy and gain to an interleaved float[]
public GainCopyToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATChannelGain channelGain ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelGain GATChannelGain
Результат void

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

Additive copy and gain to another GATData instance
public GainMixTo ( GATData destinationData, int sourceIndex, int destinationIndex, int length, float gain ) : void
destinationData GATData
sourceIndex int
destinationIndex int
length int
gain float
Результат void

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

Additive copy and gain to an interleaved float[]
public GainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATChannelGain channelGain ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelGain GATChannelGain
Результат void

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

Additive copy and gain to an interleaved float[] with extra gain parameter.
public GainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATChannelGain channelGain, float igain ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelGain GATChannelGain
igain float
Результат void

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

Gets an IntPtr pointer to the parent array. Only valid for GATData instances obtained through GATManager.GetDataContainer calls.
public GetPointer ( ) : IntPtr
Результат System.IntPtr

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

public GlissCopyFrom ( GATData sourceData, int fromIndex, double fromPitch, double toPitch ) : void
sourceData GATData
fromIndex int
fromPitch double
toPitch double
Результат void

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

public GlissCopyFrom ( float sourceArray, int fromIndex, int targetLength, double fromPitch, double toPitch ) : void
sourceArray float
fromIndex int
targetLength int
fromPitch double
toPitch double
Результат void

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

Additive copy from a float[]
public MixFrom ( float sourceArray, int destinationIndex, int sourceIndex, int length ) : void
sourceArray float
destinationIndex int
sourceIndex int
length int
Результат void

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

Performs a copy of a single channel from an interlaced source array.
public MixFromInterlaced ( float sourceArray, int sourceFrameOffset, int targetLength, int targetOffset, int channelNb, int nbOfChannels ) : void
sourceArray float
sourceFrameOffset int
targetLength int
targetOffset int
channelNb int
nbOfChannels int
Результат void

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

Additive copy and interpolated gain from a float[]
public MixSmoothedGainFrom ( float sourceArray, int sourceIndex, int destinationIndex, int length, float fromGain, float toGain ) : void
sourceArray float
sourceIndex int
destinationIndex int
length int
fromGain float
toGain float
Результат void

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

Additive copy and interpolated gain to another GATData instance
public MixSmoothedGainTo ( int sourceIndex, GATData destination, int destinationIndex, int length, float fromGain, float toGain ) : void
sourceIndex int
destination GATData
destinationIndex int
length int
fromGain float
toGain float
Результат void

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

Additive copy to another GATData instance
public MixTo ( GATData destination, int destinationIndex, int sourceIndex, int length ) : void
destination GATData
destinationIndex int
sourceIndex int
length int
Результат void

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

Additive copy to a float[]
public MixTo ( float destinationArray, int destinationIndex, int sourceIndex, int length ) : void
destinationArray float
destinationIndex int
sourceIndex int
length int
Результат void

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

Finds the next zero crossing.
public NextZeroCrossing ( int fromIndex, bool &positive ) : int
fromIndex int
positive bool /// true if the crossing /// is from a negative to a positive value. ///
Результат int

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

Applies gain to the instance's data so that the maximum value matches normalizedMax
public Normalize ( float normalizedMax ) : void
normalizedMax float
Результат void

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

Performs a resampled copy from an array to the GATData instance it is called on. The resampling algorithm performs naive linear interpolation.
public ResampleCopyFrom ( float sourceArray, double trueInterpolatedIndex, int targetLength, int targetOffset, double resamplingFactor ) : double
sourceArray float
trueInterpolatedIndex double
targetLength int
targetOffset int
resamplingFactor double
Результат double

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

Performs a resampled copy to another GATData instance. The resampling algorithm performs naive linear interpolation.
public ResampleCopyTo ( double trueInterpolatedIndex, GATData destinationSample, int targetLength, double resamplingFactor ) : double
trueInterpolatedIndex double
destinationSample GATData
targetLength int
resamplingFactor double
Результат double

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

Performs a resampled copy to another GATData instance The resampling algorithm performs naive linear interpolation. Warning: for resampling in chunks, use the method of the same name which returns a double interpolated index.
public ResampleCopyTo ( int sourceIndex, GATData destinationSample, int targetLength, double resamplingFactor ) : void
sourceIndex int
destinationSample GATData
targetLength int
resamplingFactor double
Результат void

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

Reverses the entire audio data.
public Reverse ( ) : void
Результат void

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

public Reverse ( int offset, int length ) : void
offset int
length int
Результат void

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

In-place Interpolated gain
public SmoothedGain ( int fromIndex, int length, float fromGain, float toGain ) : void
fromIndex int
length int
fromGain float
toGain float
Результат void

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

Copy and interpolated gain to an interleaved float[]
public SmoothedGainCopyToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATDynamicChannelGain channelGain ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelGain GATDynamicChannelGain
Результат void

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

Additive copy and interpolated gain to an interleaved float[]
public SmoothedGainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATDynamicChannelGain channelGain ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelGain GATDynamicChannelGain
Результат void

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

Additive copy and interpolated gain to an interleaved float[] with extra gain parameter
public SmoothedGainMixToInterlaced ( float destinationArray, int destinationOffset, int sourceIndex, int length, GATDynamicChannelGain channelGain, float igain ) : void
destinationArray float
destinationOffset int
sourceIndex int
length int
channelGain GATDynamicChannelGain
igain float
Результат void

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

Gets or sets the float in the parent array at the specified index. The indexer should only be used for quick prototyping, as it is roughly 30% slower than caching ParentArray for direct access in an extension method.
public this ( int index ) : float
index int
Результат float

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

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

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

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

protected float[] _parentArray
Результат float[]