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
파일 보기 프로젝트 열기: gregzo/G-Audio 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_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[]