Results 1 to 4 of 4

Thread: Recording voice from microphone

  1. #1
    Join Date
    Nov 2008
    Posts
    21

    Recording voice from microphone

    Hello friends,

    I have am having a query.I want to have voice recording from my Microphone.I know that we can do it by using software but i want the code for that in visual Basic.

    Can any help me out with this issue.

    Thanks in advance.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Recording voice from microphone

    Sure i will help you out with this for that you need to use the functions like waveInOpen, waveInAddBuffer , waveOutPrepareHeader etc.

  3. #3
    Join Date
    Nov 2008
    Posts
    21

    Re: Recording voice from microphone

    Thanks for replying me i am not able to make a proper use of those function and you provide me with an example i would be very thankful to you.

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Recording voice from microphone

    Sure here is the code for the same.

    HTML Code:
    class CVoiceBase  
    {
    public:
        
        CString m_result;
    
        MMRESULT res;
        enum 
        {
            SPS_8K=8000,
            SPS_11K=11025,
            SPS_22K=22050,
            SPS_44K=44100
        };
    
        enum
        {
            CH_MONO=1,
            CH_STEREO=2
        };
    
        char* buffer;
        WAVEHDR WaveHeader;
        WAVEFORMATEX PCMfmt;
    
        void SetFormat(DWORD nSamplesPerSec,  
                WORD  wBitsPerSample,WORD  nChannels);
        BOOL CopyBuffer(LPVOID lpBuffer, DWORD ntime);
        CString GetLastError();
        void GetMMResult(MMRESULT res);
        void DestroyBuffer();
        BOOL PrepareBuffer(DWORD ntime);
        
        CVoiceBase();
        virtual ~CVoiceBase();
    };
    
    class CVoiceRecording : public CVoiceBase  
    {
    public:
        void RecordFinished();
        BOOL IsOpen();
        BOOL Close();
        BOOL Open();    
        BOOL Record();
        
        HWAVEIN hWaveIn;
        
        CVoiceRecording();
        virtual ~CVoiceRecording();
    };
    
    class CVoicePlaying : public CVoiceBase  
    {
    public:
        void PlayFinished();
        BOOL IsOpen();
        BOOL Close();
        BOOL Open();
        BOOL Play();
    
        HWAVEOUT hWaveOut;
    
        CVoicePlaying();
        virtual ~CVoicePlaying();
    };

Similar Threads

  1. How to solve the sound delay in Microphone when recording in Windows 7
    By Wills Tylerr in forum Hardware Peripherals
    Replies: 7
    Last Post: 04-12-2011, 09:30 AM
  2. How to fix Fuze+Fm and Voice recording glitches?
    By Bubboy in forum Portable Devices
    Replies: 3
    Last Post: 12-09-2011, 09:37 PM
  3. Microphone Not Showing Recording Device In Remote Desktop
    By triop in forum Hardware Peripherals
    Replies: 4
    Last Post: 28-12-2010, 03:44 AM
  4. Voice recording using Bluetooth headset mic?
    By Skylar in forum Portable Devices
    Replies: 6
    Last Post: 15-10-2010, 10:37 PM
  5. Recording voice in ipod ?
    By Cody in forum Portable Devices
    Replies: 4
    Last Post: 14-01-2009, 10:46 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,173,632.68268 seconds with 17 queries