Class Resampler
Utility class for resampling audio data.
Inheritance
System.Object
Resampler
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class Resampler
Constructors
Resampler(Double)
Initializes a new instance of the Resampler class.
Declaration
public Resampler(double factor)
Parameters
Type | Name | Description |
---|---|---|
System.Double | factor | The resampling factor. |
Resampler(Int32, Int32)
Initializes a new instance of the Resampler class.
Declaration
public Resampler(int sourceClockRate, int targetClockRate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sourceClockRate | The source clock rate. |
System.Int32 | targetClockRate | The target clock rate. |
Properties
DefaultLowPassOrder
Gets or sets the default low pass order.
Declaration
public static int DefaultLowPassOrder { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Factor
Gets the resampling factor.
Declaration
public double Factor { get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
GetOutputLength(DataBuffer)
Gets the length of the output given an input set.
Declaration
public int GetOutputLength(DataBuffer input)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | input | The input. |
Returns
Type | Description |
---|---|
System.Int32 |
Resample(DataBuffer, DataBuffer)
Resamples the given audio buffer.
Declaration
public bool Resample(DataBuffer input, DataBuffer output)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | input | The input to resample. |
DataBuffer | output | The output to target. |
Returns
Type | Description |
---|---|
System.Boolean |
Resample(DataBuffer, DataBuffer, Boolean)
Resamples the given audio buffer.
Declaration
public bool Resample(DataBuffer input, DataBuffer output, bool lastBatch)
Parameters
Type | Name | Description |
---|---|---|
DataBuffer | input | The input to resample. |
DataBuffer | output | The output to target. |
System.Boolean | lastBatch | Whether or not this is the last batch. If |
Returns
Type | Description |
---|---|
System.Boolean |
|