From b0a05d7ed4eb88b474a224c0f59eb092b31c1339 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Sun, 3 Nov 2013 18:00:45 +0100 Subject: [PATCH] FFT: Take float[] instead of float --- sources/custom/FFTF32.cs | 14 ++++++++++++++ sources/gstreamer-sharp.metadata | 2 ++ 2 files changed, 16 insertions(+) diff --git a/sources/custom/FFTF32.cs b/sources/custom/FFTF32.cs index ccd3e086e6..57292ba578 100644 --- a/sources/custom/FFTF32.cs +++ b/sources/custom/FFTF32.cs @@ -28,5 +28,19 @@ namespace Gst.FFT { public FFTF32 (int len, bool inverse) { Raw = gst_fft_f32_new (len, inverse); } + + [DllImport("libgstfft-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern void gst_fft_f32_fft(IntPtr raw, float[] timedata, [MarshalAs (UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct)] FFTF32Complex[] freqdata); + + public void Fft(float[] timedata, Gst.FFT.FFTF32Complex[] freqdata) { + gst_fft_f32_fft(Handle, timedata, freqdata); + } + + [DllImport("libgstfft-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)] + static extern void gst_fft_f32_window(IntPtr raw, float[] timedata, int window); + + public void Window(float[] timedata, Gst.FFT.FFTWindow window) { + gst_fft_f32_window(Handle, timedata, (int) window); + } } } diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata index 59a43deab5..5800159593 100644 --- a/sources/gstreamer-sharp.metadata +++ b/sources/gstreamer-sharp.metadata @@ -65,6 +65,8 @@ along with this program. If not, see . true true true + true + true