public void GetAudioLevel(int data, int size, ref int leftChannelLoudness, ref int rightChannelLoudness) { try { VsNetSoundRecorderSdk.GetAudioLevel(AudioDataFormat, data, size, ref leftChannelLoudness, ref rightChannelLoudness); } catch { } }
void Dispose(bool disposing) { if (!disposedValue) { VsNetSoundRecorderSdk.SoundRecorder_FreeInstance(_handle); disposedValue = true; } }
public bool CloseDevice() { if (!IsOpen) { return(true); } _isRuningPullAudioData = false; IsOpen = !(VsNetSoundRecorderSdk.SoundRecorder_CloseRecorder(_handle) == 0); return(!IsOpen); }
public bool OpenDevice() { if (IsOpen) { return(IsOpen); } int i = 0; IsOpen = VsNetSoundRecorderSdk.SoundRecorder_OpenRecorder(_handle, ID, i) == 0; if (IsOpen) { StartPullAudioData(); } return(IsOpen); }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { foreach (var audioDevice in GetAudioDevices()) { audioDevice.Dispose(); } } VsNetSoundRecorderSdk.SoundRecorder_FreeInstance(_handle); disposedValue = true; } }
internal AudioDevice(string audioDeviceName, int Id) { ID = Id; Name = audioDeviceName; _handle = VsNetSoundRecorderSdk.SoundRecorder_CreateInstance(); }
private int GetAudioDataSize() { return(VsNetSoundRecorderSdk.SoundRecorder_GetDataSize(_handle)); }
private int GetAudioData(ref byte buff, int size) { return(VsNetSoundRecorderSdk.SoundRecorder_GetData(_handle, ref buff, size)); }
private IntPtr GetAudioDataFormat() { return(VsNetSoundRecorderSdk.SoundRecorder_GetFormat(_handle)); }
private int GetAudioDeviceTotal() { return(VsNetSoundRecorderSdk.SoundRecorder_GetSoundRecordCount(_handle)); }
private string GetAudioDeviceName(int index) { return(Marshal.PtrToStringAnsi(VsNetSoundRecorderSdk.SoundRecorder_GetSoundRecordName(_handle, index))); }
public AudioDeviceManager() { _handle = VsNetSoundRecorderSdk.SoundRecorder_CreateInstance(); }