public static void Harvest(double[] x, int x_length, int fs, HarvestOption option, double[] time_axis, double[] f0) { IntPtr ptr_time = Marshal.AllocHGlobal(Marshal.SizeOf <double>() * time_axis.Length); IntPtr ptr_f0 = Marshal.AllocHGlobal(Marshal.SizeOf <double>() * f0.Length); CoreDefinitions.Harvest(x, x_length, fs, option, ptr_time, ptr_f0); Marshal.Copy(ptr_time, time_axis, 0, time_axis.Length); Marshal.Copy(ptr_f0, f0, 0, f0.Length); Marshal.FreeHGlobal(ptr_time); Marshal.FreeHGlobal(ptr_f0); }
public void F0EstimationHarvest(double[] x, int x_length, WorldParameters world_parameters) { var option = new HarvestOption(); Core.InitializeHarvestOption(option); option.frame_period = world_parameters.frame_period; option.f0_floor = 71.0; world_parameters.f0_length = Core.GetSamplesForDIO(world_parameters.fs, x_length, world_parameters.frame_period); world_parameters.f0 = new double[world_parameters.f0_length]; world_parameters.time_axis = new double[world_parameters.f0_length]; System.Console.WriteLine("Analysis"); Core.Harvest(x, x_length, world_parameters.fs, option, world_parameters.time_axis, world_parameters.f0); }
static extern void InitOption([Out] out HarvestOption option);
static extern void Compute([In] double[] x, int x_length, int fs, [In] ref HarvestOption option, [Out] double[] temporal_positions, [Out] double[] f0);
public static void InitializeHarvestOption(HarvestOption option) => CoreDefinitions.InitializeHarvestOption(option);
public static void InitializeHarvestOption(HarvestOption option) { }
public static void Harvest(double[] x, int x_length, int fs, HarvestOption option, double[] time_axis, double[] f0) { }
public static extern void InitializeHarvestOption([Out] HarvestOption option);
public static extern void Harvest([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] double[] x, int x_length, int fs, [In] HarvestOption option, [In][Out] IntPtr time_axis, [In][Out] IntPtr f0);