这篇教程C++ waveInReset函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中waveInReset函数的典型用法代码示例。如果您正苦于以下问题:C++ waveInReset函数的具体用法?C++ waveInReset怎么用?C++ waveInReset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了waveInReset函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: waveInResetbool CSoundChannel::m_bAbort(){ DWORD dwErr = MMSYSERR_NOERROR; if(m_hWaveIn != NULL) dwErr = waveInReset(m_hWaveIn); if(m_hWaveOut != NULL) dwErr = waveOutReset(m_hWaveOut); CWaitAndSignal mutex(m_Mutex); for(int i=0; i<m_Buffers.size(); i++) { while(m_Buffers[i]->m_dwRelease() == WAVERR_STILLPLAYING) { if(m_hWaveIn != NULL) dwErr = waveInReset(m_hWaveIn); if(m_hWaveOut != NULL) dwErr = waveOutReset(m_hWaveOut); } } m_iBufByteOffset = 0x7fffffff; m_iBufIndex = 0; m_iPacket = 1; SetEvent(m_hEventDone); if(dwErr != MMSYSERR_NOERROR) return false; else return true;}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:34,
示例2: win32ai_close/** * win32ai_close() * Terminate recording. * This function discards all data that has been sampled but not read. * Return 0 if happy, -1 if error. */int win32ai_close(void) { MMRESULT res; int i; // stop device res = waveInReset(wavein); if (checkWaveInResult(wavein, res, "waveInReset")) return -1; // wait for buffers to finish and unprepare them all for (i = 0; i < WaveBuf_N; ++i) { while ((whin[i]->dwFlags & WHDR_DONE) == 0) { // buffer not ready, wait, try again WaitForSingleObject(whinEvent, INFINITE); } // unprepare the buffer res = waveInUnprepareHeader(wavein, whin[i], sizeof(WAVEHDR)); if (checkWaveInResult(wavein, res, "waveInUnprepareHeader")) return -1; // free memory free(whin[i]->lpData); free(whin[i]); } // close device res = waveInClose(wavein); if (checkWaveInResult(wavein, res, "waveInClose")) return -1; return 0;}
开发者ID:BackupTheBerlios,项目名称:nautilus,代码行数:37,
示例3: tdav_producer_waveapi_stopint tdav_producer_waveapi_stop(tmedia_producer_t* self){ tdav_producer_waveapi_t* producer = (tdav_producer_waveapi_t*)self; MMRESULT result; if(!self){ TSK_DEBUG_ERROR("Invalid parameter"); return -1; } if(!producer->started){ TSK_DEBUG_WARN("Producer not started"); return 0; } /* stop thread */ if(producer->tid[0]){ SetEvent(producer->events[1]); tsk_thread_join(&(producer->tid[0])); } /* should be done here */ producer->started = tsk_false; if(producer->hWaveIn && (((result = waveInReset(producer->hWaveIn)) != MMSYSERR_NOERROR) || ((result = waveInClose(producer->hWaveIn)) != MMSYSERR_NOERROR))){ print_last_error(result, "waveInReset/waveInClose"); } return 0;}
开发者ID:Zhe-Zhu,项目名称:Qianli,代码行数:30,
示例4: WinMMCloseCapturestatic void WinMMCloseCapture(ALCdevice *Device){ WinMMData *data = (WinMMData*)Device->ExtraData; void *buffer = NULL; int i; /* Tell the processing thread to quit and wait for it to do so. */ data->killNow = AL_TRUE; PostThreadMessage(data->thread, WM_QUIT, 0, 0); althrd_join(data->thread, &i); /* Make sure capture is stopped and all pending buffers are flushed. */ waveInReset(data->WaveHandle.In); // Release the wave buffers for(i = 0; i < 4; i++) { waveInUnprepareHeader(data->WaveHandle.In, &data->WaveBuffer[i], sizeof(WAVEHDR)); if(i == 0) buffer = data->WaveBuffer[i].lpData; data->WaveBuffer[i].lpData = NULL; } free(buffer); DestroyRingBuffer(data->Ring); data->Ring = NULL; // Close the Wave device waveInClose(data->WaveHandle.In); data->WaveHandle.In = 0; free(data); Device->ExtraData = NULL;}
开发者ID:uberpixel,项目名称:openal-soft,代码行数:34,
示例5: Stopvoid RUIAudio::RecordClose(){ Stop(); HWAVEIN hTemp = m_hWaveIn; m_hWaveIn = NULL; if (hTemp == NULL) return; RUIBuffer* pRUIBuffer = m_RecBufferList.GetFirst(); while (pRUIBuffer != NULL) { RecRemoveBuffer(pRUIBuffer); pRUIBuffer = m_RecBufferList.GetNext(pRUIBuffer); } if( hTemp == NULL ) return; if (waveInReset(hTemp) != MMSYSERR_NOERROR) ASSERT(FALSE); if (waveInClose(hTemp) != MMSYSERR_NOERROR) ASSERT(FALSE);}
开发者ID:SKplanet,项目名称:RemoteTestService,代码行数:25,
示例6: BGBMID_SoundDev_RecDeInitBMID_API int BGBMID_SoundDev_RecDeInit(){ int i; waveInStop(hWaveIn); waveInReset(hWaveIn); if(lpInWaveHdr) { for(i=0; i<WAV_BUFFERS; i++) waveInUnprepareHeader(hWaveIn, lpInWaveHdr+i, sizeof(WAVEHDR)); } waveInClose(hWaveIn); if(hInWaveHdr) { GlobalUnlock(hInWaveHdr); GlobalFree(hInWaveHdr); } if(hInData) { GlobalUnlock(hInData); GlobalFree(hInData); } return(0);}
开发者ID:cr88192,项目名称:bgbtech_engine,代码行数:30,
示例7: mmio_close_audiovoid mmio_close_audio( void){ int errcode; int nda, nad; if (sys_verbose) post("closing audio..."); for (nda=0; nda < nt_nwaveout; nda++) /*if (nt_nwaveout) wini */ { errcode = waveOutReset(ntsnd_outdev[nda]); if (errcode != MMSYSERR_NOERROR) printf("error resetting output %d: %d/n", nda, errcode); errcode = waveOutClose(ntsnd_outdev[nda]); if (errcode != MMSYSERR_NOERROR) printf("error closing output %d: %d/n",nda , errcode); } nt_nwaveout = 0; for(nad=0; nad < nt_nwavein;nad++) /* if (nt_nwavein) wini */ { errcode = waveInReset(ntsnd_indev[nad]); if (errcode != MMSYSERR_NOERROR) printf("error resetting input: %d/n", errcode); errcode = waveInClose(ntsnd_indev[nad]); if (errcode != MMSYSERR_NOERROR) printf("error closing input: %d/n", errcode); } nt_nwavein = 0;}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:29,
示例8: waveInReset//停止录音BOOL CWaveIn::CloseRecord(){ //已经停止录音 if (!m_bRecord) { //返回 return FALSE; } //录音设备句柄无效 if(!m_hIn) { //返回 return FALSE; } //重置录音设备,停止录音 m_mmr = waveInReset(m_hIn); //出错 if (m_mmr) { //返回 return FALSE; } //设置录音停止标记 m_bRecord = FALSE; //返回 return TRUE;}
开发者ID:tempbottle,项目名称:TestSet,代码行数:33,
示例9: winwave_fini_instatic void winwave_fini_in (HWVoiceIn *hw){ int i; MMRESULT mr; WaveVoiceIn *wave = (WaveVoiceIn *) hw; mr = waveInReset (wave->hwi); if (mr != MMSYSERR_NOERROR) { winwave_logerr (mr, "waveInReset"); } for (i = 0; i < conf.adc_headers; ++i) { mr = waveInUnprepareHeader (wave->hwi, &wave->hdrs[i], sizeof (wave->hdrs[i])); if (mr != MMSYSERR_NOERROR) { winwave_logerr (mr, "waveInUnprepareHeader(%d)", i); } } winwave_anal_close_in (wave); if (wave->event) { qemu_del_wait_object (wave->event, winwave_poll, wave); if (!CloseHandle (wave->event)) { dolog ("ADC CloseHandle failed %lx/n", GetLastError ()); } wave->event = NULL; } g_free (wave->pcm_buf); wave->pcm_buf = NULL; g_free (wave->hdrs); wave->hdrs = NULL;}
开发者ID:0bliv10n,项目名称:s2e,代码行数:35,
示例10: BAE_StopAudioCapture// stop the capture hardwareint BAE_StopAudioCapture(void){ MMRESULT theErr; int i; if (g_captureSound) { g_captureShutdown = TRUE; // stop streaming data theErr = BAE_PauseAudioCapture(); // release all buffers theErr = waveInReset(g_captureSound); // deallocate the capture data buffers // this could really be done in initialiation...? // is waveInReset synchronous? otherwise something bad could happen.... for (i = 0; i < BAE_WAVEIN_NUM_BUFFERS; i++) { BAE_Deallocate(g_audioBufferBlock[i]); } // for } return 0;}
开发者ID:heyigor,项目名称:miniBAE,代码行数:26,
示例11: waveOutCloseaudioStreamer_waveOut::~audioStreamer_waveOut(){ int x; if (m_hwo) waveOutReset(m_hwo); if (m_hwi) waveInReset(m_hwi); for (x = 0; x < m_bufs.GetSize(); x ++) { WAVEHDR *p = (WAVEHDR *)m_bufs.Get(x)->Get(); if (m_hwi && p) if (p->dwFlags & WHDR_PREPARED) waveInUnprepareHeader(m_hwi,p,sizeof(WAVEHDR)); if (m_hwo && p) { if (p->dwFlags & WHDR_PREPARED) waveOutUnprepareHeader(m_hwo,p,sizeof(WAVEHDR)); } delete m_bufs.Get(x); } m_bufs.Empty(); if (m_hwo) { waveOutClose(m_hwo); m_hwo=0; } if (m_hwi) { waveInClose(m_hwi); m_hwi=0; }}
开发者ID:libninjam,项目名称:libninjam-win,代码行数:31,
示例12: winaudio_in_finistatic voidwinaudio_in_fini (HWVoiceIn *hw){ WinAudioIn* s = (WinAudioIn*) hw; int i; if (s->wavein) { waveInReset(s->wavein); s->wavein = 0; } for ( i=0; i<NUM_OUT_BUFFERS; ++i ) { if ( s->buffers[i].dwUser != 0xFFFF ) { waveInUnprepareHeader( s->wavein, &s->buffers[i], sizeof(s->buffers[i]) ); s->buffers[i].dwUser = 0xFFFF; } } if (s->buffer_bytes != NULL) { qemu_free(s->buffer_bytes); s->buffer_bytes = NULL; } if (s->wavein) { waveInClose(s->wavein); s->wavein = NULL; }}
开发者ID:ACSOP,项目名称:android_external_qemu,代码行数:29,
示例13: ALCwinmmCapture_Destructstatic void ALCwinmmCapture_Destruct(ALCwinmmCapture *self){ void *buffer = NULL; int i; /* Tell the processing thread to quit and wait for it to do so. */ if(!ATOMIC_EXCHANGE(&self->killNow, AL_TRUE, almemory_order_acq_rel)) { PostThreadMessage(self->thread, WM_QUIT, 0, 0); althrd_join(self->thread, &i); /* Make sure capture is stopped and all pending buffers are flushed. */ waveInReset(self->InHdl); // Release the wave buffers for(i = 0;i < 4;i++) { waveInUnprepareHeader(self->InHdl, &self->WaveBuffer[i], sizeof(WAVEHDR)); if(i == 0) buffer = self->WaveBuffer[i].lpData; self->WaveBuffer[i].lpData = NULL; } free(buffer); } ll_ringbuffer_free(self->Ring); self->Ring = NULL; // Close the Wave device if(self->InHdl) waveInClose(self->InHdl); self->InHdl = 0; ALCbackend_Destruct(STATIC_CAST(ALCbackend, self));}
开发者ID:F4r3n,项目名称:FarenMediaLibrary,代码行数:35,
示例14: waveInReset/* * Class: com_ibm_media_protocol_device_DataSource * Method: disconnectDevice * Signature: ()V */JNIEXPORT void JNICALL Java_com_ibm_media_protocol_device_DataSource_disconnectDevice(JNIEnv* env, jobject obj) { MMRESULT result; /* first mark all pending buffers as done */ result = waveInReset(hwi); /* DEBUG */ if (result == MMSYSERR_NOERROR) printf("Device reset/n"); else printf("ERROR reseting device !/n"); /* end DEBUG */ result = waveInClose(hwi); /* DEBUG */ if (result == MMSYSERR_NOERROR) printf("Device closed/n"); else printf("ERROR closing device !/n"); /* end DEBUG */}
开发者ID:TheCrazyT,项目名称:jmf,代码行数:30,
示例15: ad_stop_recint32ad_stop_rec(ad_rec_t * r){ int32 i, st; if ((!r->opened) || (!r->recording)) return -1; if (waveInStop(r->h_wavein) != 0) return AD_ERR_WAVE; if ((st = waveInReset(r->h_wavein)) != 0) { wavein_error("waveInReset", st); return AD_ERR_WAVE; } /* Wait until all buffers marked done */ for (i = 0; i < r->n_buf; i++) while (!(r->wi_buf[i].p_whdr->dwFlags & WHDR_DONE)); if ((r->lastbuf = r->curbuf - 1) < 0) r->lastbuf = r->n_buf - 1; r->recording = 0; return 0;}
开发者ID:AtDinesh,项目名称:Jaf_pose_est,代码行数:27,
示例16: WaveInStartvoid WaveInStart(WaveIn *waveIn, BOOL prep){ MMRESULT res; res = waveInReset(waveIn->handler); if(res) { return; } // prepare header an add the buffer waveIn->header.lpData = (char *) waveIn->data; waveIn->header.dwBufferLength = waveIn->n * 2; waveIn->header.dwBytesRecorded = 0; waveIn->header.dwFlags = 0L; waveIn->header.dwLoops = 0L; waveIn->header.dwUser = 0L; waveInPrepareHeader(waveIn->handler, &waveIn->header, sizeof(WAVEHDR)); res = waveInAddBuffer(waveIn->handler, &waveIn->header, sizeof(WAVEHDR)); if(res) { return; } res = waveInStart(waveIn->handler); if(res) { return; }}
开发者ID:forart,项目名称:virtual-tuner,代码行数:28,
示例17: audio_closeint audio_close(snd_type snd){ int i; MMRESULT er; buffer_state *bs = (buffer_state *) snd->u.audio.descriptor; if (snd->write_flag == SND_READ) { if (er = waveInReset(bs->u.h_in)) { mm_error_handler(snd, er, snd_fail); return !SND_SUCCESS; } if (er = waveInClose(bs->u.h_in)) { mm_error_handler(snd, er, snd_fail); return !SND_SUCCESS; } } else { // SND_WRITE if (er = waveOutReset(bs->u.h_out)) { mm_error_handler(snd, er, snd_fail); return !SND_SUCCESS; } if (er = waveOutClose(bs->u.h_out)) { mm_error_handler(snd, er, snd_fail); return !SND_SUCCESS; } } for (i = 0; i < bs->numofbuffers; i++) { snd_free(bs->whdr[i].lpData); } snd_free(bs->whdr); snd_free(bs); if (rt_devices_open) { timeEndPeriod(1); rt_devices_open--; } return SND_SUCCESS;}
开发者ID:lackofentropy,项目名称:nyquist,代码行数:35,
示例18: m_bAbortbool CSoundChannel::m_bCloseAudio(){ if(m_bClose) return m_bClose; m_bAbort(); if(m_hWaveOut != NULL) { while(waveOutClose(m_hWaveOut) == WAVERR_STILLPLAYING) //关闭WAVEOUT设备 waveOutReset(m_hWaveOut); m_hWaveOut = NULL; } if(m_hWaveIn != NULL) { while(waveInClose(m_hWaveIn) == WAVERR_STILLPLAYING) //关闭WAVEIN设备 waveInReset(m_hWaveIn); m_hWaveIn = NULL; } m_bAbort(); m_uOldHandle = -1; m_bClose = true; return true;}
开发者ID:wonktnodi,项目名称:webrtc_port,代码行数:27,
示例19: waveInResetvoid CAudio2Dlg::OnRecStop() {bEnding=TRUE; waveInReset(hWaveIn); }
开发者ID:3660628,项目名称:SoundTest,代码行数:7,
示例20: waveInStopCAudio::~CAudio(){ if (m_bIsWaveInUsed) { waveInStop(m_hWaveIn); waveInReset(m_hWaveIn); for (int i = 0; i < 2; i++) waveInUnprepareHeader(m_hWaveIn, m_lpInAudioHdr[i], sizeof(WAVEHDR)); waveInClose(m_hWaveIn); TerminateThread(m_hThreadCallBack, -1); } if (m_bIsWaveOutUsed) { waveOutReset(m_hWaveOut); for (int i = 0; i < 2; i++) waveOutUnprepareHeader(m_hWaveOut, m_lpInAudioHdr[i], sizeof(WAVEHDR)); waveOutClose(m_hWaveOut); } for (int i = 0; i < 2; i++) { delete [] m_lpInAudioData[i]; delete m_lpInAudioHdr[i]; delete [] m_lpOutAudioData[i]; delete m_lpOutAudioHdr[i]; } CloseHandle(m_hEventWaveIn); CloseHandle(m_hStartRecord); CloseHandle(m_hThreadCallBack);}
开发者ID:nickwu1220,项目名称:PCRemote,代码行数:34,
示例21: waveInResetvoid QAudioInputPrivate::suspend(){ if(deviceState == QAudio::ActiveState) { waveInReset(hWaveIn); deviceState = QAudio::SuspendedState; emit stateChanged(deviceState); }}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:8,
示例22: ph_media_stopvoid ph_media_stop(phcall_t *ca){ phmstream_t *stream = (phmstream_t *) ca->phstream; ca->hasaudio = 0; ca->phstream = 0; stream->running = 0; osip_thread_join(stream->audio_in_thread); osip_thread_join(stream->audio_out_thread); osip_free(stream->audio_in_thread); osip_free(stream->audio_out_thread); rtp_session_signal_disconnect_by_callback(stream->rtp_session, "telephone-event", (RtpCallback)ph_telephone_event); ortp_set_debug_file("oRTP", stdout); ortp_global_stats_display(); ortp_set_debug_file("oRTP", NULL); rtp_session_destroy(stream->rtp_session);#if USE_CODECS if (stream->codec->encoder_cleanup) stream->codec->encoder_cleanup(stream->encoder_ctx); if (stream->codec->decoder_cleanup) stream->codec->decoder_cleanup(stream->decoder_ctx);#endif /* !USE_CODECS */ waveInReset(stream->hWaveIn); waveInClose(stream->hWaveIn); waveOutReset(stream->hWaveOut); waveOutClose(stream->hWaveOut);#if DO_ECHO_CAN printf("/nbytes echoed %d %d/n", stream->sent_cnt, stream->recv_cnt); free(stream->pcm_sent);# if !AEC_BIS if(stream->ec) echo_can_free(stream->ec);# else /* AEC_BIS */ kill_AEC();# endif /* AEC_BIS */ g_mutex_free(stream->synclock); g_cond_free(stream->sync_cond); g_mutex_free(stream->aec_mutex);#endif /* !DO_ECHO_CAN */ g_mutex_free(stream->dtmfg_lock); osip_free(stream);}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:58,
示例23: PJ_DEF/* * Destroy stream. */PJ_DEF(pj_status_t) pjmedia_snd_stream_close(pjmedia_snd_stream *stream){ unsigned i; PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); pjmedia_snd_stream_stop(stream); if (stream->thread) { SetEvent(stream->thread_quit_event); pj_thread_join(stream->thread); pj_thread_destroy(stream->thread); stream->thread = NULL; } /* Unprepare the headers and close the play device */ if (stream->play_strm.hWave.Out) { waveOutReset(stream->play_strm.hWave.Out); for (i = 0; i < stream->play_strm.dwMaxBufIdx; ++i) waveOutUnprepareHeader(stream->play_strm.hWave.Out, &(stream->play_strm.WaveHdr[i]), sizeof(WAVEHDR)); waveOutClose(stream->play_strm.hWave.Out); stream->play_strm.hWave.Out = NULL; } /* Close the play event */ if (stream->play_strm.hEvent) { CloseHandle(stream->play_strm.hEvent); stream->play_strm.hEvent = NULL; } /* Unprepare the headers and close the record device */ if (stream->rec_strm.hWave.In) { waveInReset(stream->rec_strm.hWave.In); for (i = 0; i < stream->play_strm.dwMaxBufIdx; ++i) waveInUnprepareHeader(stream->rec_strm.hWave.In, &(stream->rec_strm.WaveHdr[i]), sizeof(WAVEHDR)); waveInClose(stream->rec_strm.hWave.In); stream->rec_strm.hWave.In = NULL; } /* Close the record event */ if (stream->rec_strm.hEvent) { CloseHandle(stream->rec_strm.hEvent); stream->rec_strm.hEvent = NULL; } pj_pool_release(stream->pool); return PJ_SUCCESS;}
开发者ID:deveck,项目名称:Deveck.TAM,代码行数:61,
示例24: waveOutResetvoid CAudioCollect::Stop(){ bStart = false; bReset = true; waveOutReset(m_hWaveOut); waveOutClose(m_hWaveOut); waveInReset(m_hWaveIn); waveInClose(m_hWaveIn);}
开发者ID:prehawk1999,项目名称:VocalChat,代码行数:9,
示例25: stop_soundvoid stop_sound(void){ if (sound_recording) { sound_recording = 0; error_code = waveInReset(hwavein); if( error_code != MMSYSERR_NOERROR) errormsg("Unable to stop sound recording.",error_code); stop_encoder(); } SetDlgItemText(hMainDialog,IDC_LISTEN_INDICATOR,""); meter_off();}
开发者ID:TwilightSuzuka,项目名称:The_Podside_Project,代码行数:11,
示例26: Mic_DeInit_PhysicalBOOL Mic_DeInit_Physical(){ if(!Mic_Inited) return TRUE; INFO("win32 microphone DEinit OK/n"); Mic_Inited = FALSE; waveInReset(waveIn); waveInClose(waveIn); return TRUE;}
开发者ID:boucha05,项目名称:desmume,代码行数:14,
示例27: closebool UBWaveRecorder::close(){ if (waveInReset(mWaveInDevice) != MMSYSERR_NOERROR) { setLastErrorMessage("Cannot reset wave in device "); return false; } foreach(WAVEHDR* buffer, mWaveBuffers) { waveInUnprepareHeader(mWaveInDevice, buffer, sizeof(WAVEHDR)); delete [] buffer->lpData; delete buffer; }
开发者ID:199901,项目名称:Sankore-3.1,代码行数:14,
示例28: waveInResetvoid WaveIn::close(){ waveInReset(hWaveIn); while (!waveHeaders.IsEmpty()) { LPWAVEHDR pwh = (LPWAVEHDR) waveHeaders.RemoveHead(); waveInUnprepareHeader(hWaveIn, pwh, sizeof(WAVEHDR)); delete []pwh->lpData; delete pwh; } waveInClose(hWaveIn); hWaveIn = NULL;}
开发者ID:bugou,项目名称:test,代码行数:14,
注:本文中的waveInReset函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ waveInStart函数代码示例 C++ waveInPrepareHeader函数代码示例 |