Exemplo n.º 1
0
 public VoiceRecorder()
 {
     voicerec                    = new CM_VOICE_RECORDER();
     handle                      = new IntPtr();
     voicerec.cb                 = (int)Marshal.SizeOf(voicerec); //26
     voicerec.dwStyle            = wndStyle.VRS_NO_OK | wndStyle.VRS_NO_MOVE;
     voicerec.xPos               = -1;
     voicerec.yPos               = -1;
     voicerec.lpszRecordFileName = Marshal.StringToBSTR("\\myFile.wav");
 }
        public unsafe VoiceRecorder(string _audioFile)
        {
            wavFile = _audioFile;
             _hRecorder = new IntPtr();
             char[] temp = new char[200];

             this.Hwnd = GetForegroundWindow();

             // Populate temp with the file path of the WAV file
             Buffer.BlockCopy(wavFile.ToCharArray(), 0, temp, 0, 2 * wavFile.Length);

             fixed (char* lpszFileName = temp)
             {
                 _VoiceRec = new CM_VOICE_RECORDER();

                 _VoiceRec.hwndParent = _Hwnd;
                 _VoiceRec.dwStyle = wndStyle.VRS_NO_MOVE | wndStyle.VRS_MODAL;
                 _VoiceRec.cb = (int)Marshal.SizeOf(_VoiceRec);
                 _VoiceRec.xPos = -1;
                 _VoiceRec.yPos = -1;
                 _VoiceRec.lpszRecordFileName = lpszFileName;
             }
        }
Exemplo n.º 3
0
        public unsafe VoiceRecorder(string _audioFile)
        {
            wavFile    = _audioFile;
            _hRecorder = new IntPtr();
            char[] temp = new char[200];

            this.Hwnd = GetForegroundWindow();

            // Populate temp with the file path of the WAV file
            Buffer.BlockCopy(wavFile.ToCharArray(), 0, temp, 0, 2 * wavFile.Length);

            fixed(char *lpszFileName = temp)
            {
                _VoiceRec = new CM_VOICE_RECORDER();

                _VoiceRec.hwndParent         = _Hwnd;
                _VoiceRec.dwStyle            = wndStyle.VRS_NO_MOVE | wndStyle.VRS_MODAL;
                _VoiceRec.cb                 = (int)Marshal.SizeOf(_VoiceRec);
                _VoiceRec.xPos               = -1;
                _VoiceRec.yPos               = -1;
                _VoiceRec.lpszRecordFileName = lpszFileName;
            }
        }
 private static unsafe extern IntPtr VoiceRecorder_Create(CM_VOICE_RECORDER* voicerec);
Exemplo n.º 5
0
 private static extern IntPtr VoiceRecorder_Create(ref CM_VOICE_RECORDER voicerec);
Exemplo n.º 6
0
 public VoiceRecorder()
 {
     voicerec = new CM_VOICE_RECORDER();
     handle = new IntPtr();
     voicerec.cb = (int)Marshal.SizeOf(voicerec);  //26
     voicerec.dwStyle = wndStyle.VRS_NO_OK | wndStyle.VRS_NO_MOVE;
     voicerec.xPos = -1;
     voicerec.yPos = -1;
     voicerec.lpszRecordFileName = Marshal.StringToBSTR("\\myFile.wav");
 }
Exemplo n.º 7
0
 private static extern IntPtr VoiceRecorder_Create(ref CM_VOICE_RECORDER voicerec);