Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to stop Recording..?

How to stop Recording..?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mpallavi
    wrote on last edited by
    #1

    Hello.. I am using MCI for recording sound.. I am using the sample code given in MSDN for recording.. This allows me to record sound only for specified amount of time.. I want to generalise it so that, recording stops when i click on the stop button.. At present what i am doing is as follows: void CCNPhoneAdapterDlg::OnRecord() { RecordWaveFile(10000); } DWORD CCNPhoneAdapterDlg::RecordWaveFile(DWORD dwMilliSeconds) { // Begin recording and record for the specified number of // milliseconds. Wait for recording to complete before continuing. // Assume the default time format for the waveform-audio device // (milliseconds). mciRecordParms.dwTo = dwMilliSeconds; if (dwReturn = mciSendCommand(wDeviceID, MCI_RECORD, MCI_TO | MCI_WAIT, (DWORD)(LPVOID) &mciRecordParms)) { mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); return (dwReturn); } // Save the recording to a file named TEMPFILE.WAV. Wait for // the operation to complete before continuing. mciSaveParms.lpfilename = "tempfile.wav"; if (dwReturn = mciSendCommand(wDeviceID, MCI_SAVE, MCI_SAVE_FILE | MCI_WAIT, (DWORD)(LPVOID) &mciSaveParms)) { mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL); return (dwReturn); } return (0L); } ................ Also i want to allow the user to specify the location and file name to store the recorded sound. Can anyone help me? Regards Pallavi

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups