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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. help me

help me

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
2 Posts 2 Posters 0 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.
  • S Offline
    S Offline
    sunita ramesh
    wrote on last edited by
    #1

    hi all, I have the following coding to extract audio from video.. void CWave::ReadWaveFile(unsigned long *sp_long_In) { char *sp_char, cConst[3]; char cBuf[3]; unsigned long *sp_long; int i, j; int iflag; //WaveCount, WAVE_CHARTOLONG Wave_chartolong; sp_char = m_DECbuf; m_DECwavdata = new unsigned long[m_DECcount]; sp_long = sp_long_In; cConst[0] = 'P'; cConst[1] = 'C'; cConst[2] = 'M'; i = 1; j = 0; while( i <= (m_DECcount * 2)) { sp_char = m_DECbuf + sp_long[i]; Wave_chartolong.CharBuff[0] = *(sp_char + 4); Wave_chartolong.CharBuff[1] = *(sp_char + 5); Wave_chartolong.CharBuff[2] = *(sp_char + 6); Wave_chartolong.CharBuff[3] = *(sp_char + 7); sp_char += Wave_chartolong.UL; memcpy(cBuf, sp_char, 3); iflag = memcmp(cBuf, cConst, 3); if(iflag == 0) { m_DECwavdata[j] = (unsigned long)sp_char; j = j + 1; } i += 2; } ReadyPlayWave(); } void CWave::ReadyPlayWave() { lpFormat = new WAVEFORMATEX; lpFormat->wFormatTag = 1; lpFormat->nChannels = 1; //lpFormat->nSamplesPerSec = 16000; //lpFormat->nAvgBytesPerSec = 16000; //lpFormat->nSamplesPerSec = 8000; //lpFormat->nAvgBytesPerSec = 8000; lpFormat->nSamplesPerSec = 7500; lpFormat->nAvgBytesPerSec = 7500; lpFormat->wBitsPerSample = 8; lpFormat->nBlockAlign = 1; lpFormat->cbSize = 0; } Can any one please review it. here Audio is extracted in ReadWave file and we can play the video by ReadyPlaywave (). I can able to play audio.but i have to save that audio in .wav format.Is it posiible. how to do that. help me plzz Thanks, Sunita

    H 1 Reply Last reply
    0
    • S sunita ramesh

      hi all, I have the following coding to extract audio from video.. void CWave::ReadWaveFile(unsigned long *sp_long_In) { char *sp_char, cConst[3]; char cBuf[3]; unsigned long *sp_long; int i, j; int iflag; //WaveCount, WAVE_CHARTOLONG Wave_chartolong; sp_char = m_DECbuf; m_DECwavdata = new unsigned long[m_DECcount]; sp_long = sp_long_In; cConst[0] = 'P'; cConst[1] = 'C'; cConst[2] = 'M'; i = 1; j = 0; while( i <= (m_DECcount * 2)) { sp_char = m_DECbuf + sp_long[i]; Wave_chartolong.CharBuff[0] = *(sp_char + 4); Wave_chartolong.CharBuff[1] = *(sp_char + 5); Wave_chartolong.CharBuff[2] = *(sp_char + 6); Wave_chartolong.CharBuff[3] = *(sp_char + 7); sp_char += Wave_chartolong.UL; memcpy(cBuf, sp_char, 3); iflag = memcmp(cBuf, cConst, 3); if(iflag == 0) { m_DECwavdata[j] = (unsigned long)sp_char; j = j + 1; } i += 2; } ReadyPlayWave(); } void CWave::ReadyPlayWave() { lpFormat = new WAVEFORMATEX; lpFormat->wFormatTag = 1; lpFormat->nChannels = 1; //lpFormat->nSamplesPerSec = 16000; //lpFormat->nAvgBytesPerSec = 16000; //lpFormat->nSamplesPerSec = 8000; //lpFormat->nAvgBytesPerSec = 8000; lpFormat->nSamplesPerSec = 7500; lpFormat->nAvgBytesPerSec = 7500; lpFormat->wBitsPerSample = 8; lpFormat->nBlockAlign = 1; lpFormat->cbSize = 0; } Can any one please review it. here Audio is extracted in ReadWave file and we can play the video by ReadyPlaywave (). I can able to play audio.but i have to save that audio in .wav format.Is it posiible. how to do that. help me plzz Thanks, Sunita

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      See Here[^] maybe it is some helpful to you_**


      **_

      whitesky


      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