help me
-
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 -
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