Files
librubberband/dotnet/rubberband-sharp/RubberBandNativeMethodsx64.cs

105 lines
5.6 KiB
C#
Raw Normal View History

/*
rubberband-sharp
A consumer of the rubberband DLL that wraps the RubberBandStretcher
object exposed by the DLL in a managed .NET type.
Copyright 2018-2019 Jonathan Gilbert
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Jonathan Gilbert
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written
authorization.
*/
using System;
using System.Runtime.InteropServices;
namespace RubberBand
{
internal class RubberBandNativeMethodsx64
{
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_Create(IntPtr sampleRate, IntPtr channels, int options = 0, double initialTimeRatio = 1.0, double initialPitchScale = 1.0);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_Delete(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_Reset(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetTimeRatio(IntPtr rbs, double ratio);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetPitchScale(IntPtr rbs, double scale);
[DllImport("rubberband-dll-x64")]
public static extern double RubberBandStretcher_GetTimeRatio(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern double RubberBandStretcher_GetPitchScale(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetLatency(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetTransientsOption(IntPtr rbs, int options);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetDetectorOption(IntPtr rbs, int options);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetPhaseOption(IntPtr rbs, int options);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetFormantOption(IntPtr rbs, int options);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetPitchOption(IntPtr rbs, int options);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetExpectedInputDuration(IntPtr rbs, IntPtr samples);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetMaxProcessSize(IntPtr rbs, IntPtr samples);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetSamplesRequired(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetKeyFrameMap(IntPtr rbs, IntPtr[] mappingData, int numberOfMappings);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_Study(IntPtr rbs, float[] input, IntPtr samples, int channels, bool final);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_Process(IntPtr rbs, float[] input, IntPtr samples, int channels, bool final);
[DllImport("rubberband-dll-x64")]
public static extern int RubberBandStretcher_Available(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_Retrieve(IntPtr rbs, float[] output, IntPtr samples, int channels);
[DllImport("rubberband-dll-x64")]
public static extern float RubberBandStretcher_GetFrequencyCutoff(IntPtr rbs, int n);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetFrequencyCutoff(IntPtr rbs, int n, float f);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetInputIncrement(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetOutputIncrements(IntPtr rbs, int[] buffer, IntPtr bufferSize);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetPhaseResetCurve(IntPtr rbs, float[] buffer, IntPtr bufferSize);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetExactTimePoints(IntPtr rbs, int[] buffer, IntPtr bufferSize);
[DllImport("rubberband-dll-x64")]
public static extern IntPtr RubberBandStretcher_GetChannelCount(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_CalculateStretch(IntPtr rbs);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetDebugLevel(IntPtr rbs, int level);
[DllImport("rubberband-dll-x64")]
public static extern void RubberBandStretcher_SetDefaultDebugLevel(int level);
}
}