Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 19-03-2009
Member
 
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.
Reply With Quote
  #2  
Old 19-03-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
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.
Reply With Quote
  #3  
Old 19-03-2009
Member
 
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.
Reply With Quote
  #4  
Old 19-03-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
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();
};
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 04:55 PM.