public ChannelSpectrum(float[] spectrumArray, int numberOfValues, int channelOffset, DspFftWindow windowType) { SpectrumArray = spectrumArray; NumberOfValues = numberOfValues; ChannelOffset = channelOffset; WindowType = windowType; }
public float[] GetSpectrumData(int spectrumResolution, int spectrumChannelOffset, DspFftWindow spectrumDspWindowType) { float[] spectrumArray = null; currentResult = NativeMethods.FMOD_System_GetSpectrum(handle, spectrumArray, spectrumResolution, spectrumChannelOffset, spectrumDspWindowType); return spectrumArray; }
/// <summary> /// Get a representation of the sound spectrum data /// </summary> /// <param name="spectrumResolution">The resolution of the spectrum data</param> /// <param name="spectrumChannelOffset">Which channel of the sound to get spectrum data from (0 is left, 1 is right)</param> /// <param name="spectrumDspWindowType">The type of fast fourier transform to use for mapping the spectrum data</param> /// <returns>An array of floats</returns> /// <remarks>A common value for spectrumResolution is 2048, /// the minimum value is 64, the maximum value is 8192, all values should be powers of 2</remarks> public float[] GetSpectrumData(int spectrumResolution, int spectrumChannelOffset, DspFftWindow spectrumDspWindowType) { float[] spectrumArray = null; currentResult = NativeMethods.FMOD_ChannelGroup_GetSpectrum(handle, spectrumArray, spectrumResolution, spectrumChannelOffset, spectrumDspWindowType); return(spectrumArray); }
internal static extern Result FMOD_Channel_GetSpectrum(IntPtr channelHandle, [MarshalAs(UnmanagedType.LPArray)] float[] spectrumArray, int numberOfValues, int channelOffset, DspFftWindow windowType);
internal static extern Result FMOD_System_GetSpectrum(IntPtr systemHandle, [MarshalAs(UnmanagedType.LPArray)] float[] spectrumArray, int numberOfValues, int channelOffset, DspFftWindow windowType);