示例#1
0
 public void GetAudioLevel(int data, int size, ref int leftChannelLoudness, ref int rightChannelLoudness)
 {
     try
     {
         VsNetSoundRecorderSdk.GetAudioLevel(AudioDataFormat, data, size, ref leftChannelLoudness, ref rightChannelLoudness);
     }
     catch { }
 }
示例#2
0
 void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         VsNetSoundRecorderSdk.SoundRecorder_FreeInstance(_handle);
         disposedValue = true;
     }
 }
示例#3
0
        public bool CloseDevice()
        {
            if (!IsOpen)
            {
                return(true);
            }

            _isRuningPullAudioData = false;

            IsOpen = !(VsNetSoundRecorderSdk.SoundRecorder_CloseRecorder(_handle) == 0);
            return(!IsOpen);
        }
示例#4
0
        public bool OpenDevice()
        {
            if (IsOpen)
            {
                return(IsOpen);
            }
            int i = 0;

            IsOpen = VsNetSoundRecorderSdk.SoundRecorder_OpenRecorder(_handle, ID, i) == 0;
            if (IsOpen)
            {
                StartPullAudioData();
            }
            return(IsOpen);
        }
示例#5
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposedValue)
     {
         if (disposing)
         {
             foreach (var audioDevice in GetAudioDevices())
             {
                 audioDevice.Dispose();
             }
         }
         VsNetSoundRecorderSdk.SoundRecorder_FreeInstance(_handle);
         disposedValue = true;
     }
 }
示例#6
0
 internal AudioDevice(string audioDeviceName, int Id)
 {
     ID      = Id;
     Name    = audioDeviceName;
     _handle = VsNetSoundRecorderSdk.SoundRecorder_CreateInstance();
 }
示例#7
0
 private int GetAudioDataSize()
 {
     return(VsNetSoundRecorderSdk.SoundRecorder_GetDataSize(_handle));
 }
示例#8
0
 private int GetAudioData(ref byte buff, int size)
 {
     return(VsNetSoundRecorderSdk.SoundRecorder_GetData(_handle, ref buff, size));
 }
示例#9
0
 private IntPtr GetAudioDataFormat()
 {
     return(VsNetSoundRecorderSdk.SoundRecorder_GetFormat(_handle));
 }
示例#10
0
 private int GetAudioDeviceTotal()
 {
     return(VsNetSoundRecorderSdk.SoundRecorder_GetSoundRecordCount(_handle));
 }
示例#11
0
 private string GetAudioDeviceName(int index)
 {
     return(Marshal.PtrToStringAnsi(VsNetSoundRecorderSdk.SoundRecorder_GetSoundRecordName(_handle, index)));
 }
示例#12
0
 public AudioDeviceManager()
 {
     _handle = VsNetSoundRecorderSdk.SoundRecorder_CreateInstance();
 }