Click here to Skip to main content
15,888,527 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problem [modified] Pin
V_shr6-Jun-06 2:49
V_shr6-Jun-06 2:49 
GeneralRe: problem [modified] Pin
Cedric Moonen6-Jun-06 3:13
Cedric Moonen6-Jun-06 3:13 
GeneralRe: problem [modified] Pin
V_shr6-Jun-06 3:25
V_shr6-Jun-06 3:25 
GeneralRe: problem [modified] Pin
Cedric Moonen6-Jun-06 3:29
Cedric Moonen6-Jun-06 3:29 
GeneralRe: problem [modified] Pin
V_shr6-Jun-06 3:44
V_shr6-Jun-06 3:44 
GeneralRe: problem [modified] Pin
Viorel.6-Jun-06 3:16
Viorel.6-Jun-06 3:16 
QuestionRe: problem Pin
David Crow6-Jun-06 3:16
David Crow6-Jun-06 3:16 
Questionhow to record audio Pin
ramyasangeet6-Jun-06 1:58
ramyasangeet6-Jun-06 1:58 
hi all,

I have a video player that plays video files(.cam).Everthing is working fine.I can even able to extract audio and save it as .wav file.

This is the code where i record audio .

DWORD CWave::recordWAVEFile(DWORD dwMilliSeconds) <br />
{ <br />
    UINT wDeviceID; <br />
    DWORD dwReturn; <br />
    MCI_OPEN_PARMS mciOpenParms; <br />
    MCI_RECORD_PARMS mciRecordParms; <br />
    MCI_SAVE_PARMS mciSaveParms; <br />
    MCI_PLAY_PARMS mciPlayParms; <br />
   <br />
    // Open a waveform-audio device with a new file for recording. <br />
    mciOpenParms.lpstrDeviceType = "waveaudio"; <br />
    mciOpenParms.lpstrElementName = ""; <br />
    if (dwReturn = mciSendCommand(0, MCI_OPEN, <br />
        MCI_OPEN_ELEMENT | MCI_OPEN_TYPE, <br />
        (DWORD)(LPVOID) &mciOpenParms)) <br />
    { <br />
        // Failed to open device; don't close it, just return error. <br />
        return (dwReturn); <br />
    } <br />
<br />
    // The device opened successfully; get the device ID. <br />
    wDeviceID = mciOpenParms.wDeviceID; <br />
<br />
    // Begin recording and record for the specified number of <br />
    // milliseconds. Wait for recording to complete before continuing. <br />
    // Assume the default time format for the waveform-audio device <br />
    // (milliseconds). <br />
    mciRecordParms.dwTo = dwMilliSeconds; <br />
    if (dwReturn = mciSendCommand(wDeviceID, MCI_RECORD, <br />
        MCI_TO | MCI_WAIT, (DWORD)(LPVOID) &mciRecordParms)) <br />
    { <br />
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
        return (dwReturn); <br />
    } <br />
<br />
  // Play the recording and query user to save the file. <br />
   /* mciPlayParms.dwFrom = 0L; <br />
    if (dwReturn = mciSendCommand(wDeviceID, MCI_PLAY, <br />
        MCI_FROM | MCI_WAIT, (DWORD)(LPVOID) &mciPlayParms)) <br />
    { <br />
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
        return (dwReturn); <br />
    } */<br />
    if (MessageBox(hMainWnd, "Do you want to save this recording?", <br />
        "", MB_YESNO) == IDNO) <br />
    { <br />
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
        return (0L); <br />
    } <br />
<br />
    // Save the recording to a file named TEMPFILE.WAV. Wait for <br />
    // the operation to complete before continuing. <br />
    mciSaveParms.lpfilename = "c:\\file.wav"; <br />
    if (dwReturn = mciSendCommand(wDeviceID, MCI_SAVE, <br />
        MCI_SAVE_FILE | MCI_WAIT, (DWORD)(LPVOID) &mciSaveParms)) <br />
    { <br />
        mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); <br />
        return (dwReturn); <br />
    } <br />
    return (0L); <br />
} 



But my problem,it takes more time to record and not allowing to play the video.
(recording is done at first)

Can I do recording the audio and playing video simultaneously..


help me please..

cheers

sangeet
AnswerRe: how to record audio Pin
Cedric Moonen6-Jun-06 2:08
Cedric Moonen6-Jun-06 2:08 
QuestionDEBUG_NEW Problem Pin
Jethro636-Jun-06 1:48
Jethro636-Jun-06 1:48 
AnswerRe: DEBUG_NEW Problem Pin
Laxman Auti6-Jun-06 1:55
Laxman Auti6-Jun-06 1:55 
GeneralRe: DEBUG_NEW Problem Pin
Jethro636-Jun-06 2:02
Jethro636-Jun-06 2:02 
AnswerRe: DEBUG_NEW Problem Pin
toxcct6-Jun-06 2:01
toxcct6-Jun-06 2:01 
AnswerRe: DEBUG_NEW Problem Pin
Viorel.6-Jun-06 2:25
Viorel.6-Jun-06 2:25 
GeneralRe: DEBUG_NEW Problem Pin
Jethro636-Jun-06 2:31
Jethro636-Jun-06 2:31 
Questionopen a file in binary mode Pin
V_shr6-Jun-06 1:28
V_shr6-Jun-06 1:28 
AnswerRe: open a file in binary mode Pin
Cedric Moonen6-Jun-06 1:31
Cedric Moonen6-Jun-06 1:31 
GeneralRe: open a file in binary mode Pin
V_shr6-Jun-06 1:34
V_shr6-Jun-06 1:34 
GeneralRe: open a file in binary mode Pin
Cedric Moonen6-Jun-06 1:36
Cedric Moonen6-Jun-06 1:36 
AnswerRe: open a file in binary mode Pin
toxcct6-Jun-06 1:32
toxcct6-Jun-06 1:32 
AnswerRe: open a file in binary mode Pin
V_shr6-Jun-06 1:35
V_shr6-Jun-06 1:35 
AnswerRe: open a file in binary mode Pin
Viorel.6-Jun-06 1:35
Viorel.6-Jun-06 1:35 
Questionlogger threads Pin
bujji_bec6-Jun-06 1:26
bujji_bec6-Jun-06 1:26 
AnswerRe: logger threads Pin
ThatsAlok6-Jun-06 19:37
ThatsAlok6-Jun-06 19:37 
Questiondate Pin
p_6-Jun-06 1:24
p_6-Jun-06 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.