コード例 #1
0
 public void ProcessFrame(float[] data, int sampleCount)
 {
     fixed(float *fptr = &data[0])
     {
         NativeMethodsx64.ProcessFramef(this.nativePointer, new IntPtr(fptr), sampleCount);
     }
 }
コード例 #2
0
 public void Dispose()
 {
     if (nativePointer != IntPtr.Zero)
     {
         NativeMethodsx64.DeleteGistf(this.nativePointer);
         this.nativePointer = IntPtr.Zero;
     }
 }
コード例 #3
0
        public float GetFeature(AudioFeaturesFlags flag)
        {
            fixed(float *fptr = &this.featureData[0])
            {
                NativeMethodsx64.RetrieveFeaturesf(this.nativePointer, new IntPtr(fptr), flag);
            }

            return(this.featureData[0]);
        }
コード例 #4
0
        public Dictionary <AudioFeaturesFlags, float> GetFeatures(AudioFeaturesFlags flags)
        {
            Dictionary <AudioFeaturesFlags, float> result = new Dictionary <AudioFeaturesFlags, float>();

            fixed(float *fptr = &this.featureData[0])
            {
                NativeMethodsx64.RetrieveFeaturesf(this.nativePointer, new IntPtr(fptr), flags);
            }

            int offset  = 0;
            int feature = 1;

            for (int i = 0; i < 11; i++)
            {
                AudioFeaturesFlags f = (AudioFeaturesFlags)feature;
                if (flags.HasFlag(f))
                {
                    result.Add(f, this.featureData[offset]);
                    offset++;
                }
                feature *= 2;
            }
            return(result);
        }
コード例 #5
0
 public Gist(int sampleRate, int frameSize)
 {
     this.nativePointer = NativeMethodsx64.CreateGistf(frameSize, sampleRate);
     this.frameSize     = frameSize;
     this.spectrumData  = new float[frameSize / 2];
 }