杞人 发表于 2013-9-19 10:27:59

轻松实现音频录制播放等等功能

原文连接:http://eightquit.com/post/256668_8d919e其实是调用微软的mci播放工具呵呵挺简单的我只是写了一个粗糙版的 大家自己完善就可以了**** Hidden Message *****BOOL CTestMciDlg::mciExecute(LPCTSTR szCommand){MCIERRORerror ;TCHAR    szErrorStr ;if (error = mciSendString (szCommand, NULL, 0, NULL)){mciGetErrorString (error, szErrorStr, sizeof (szErrorStr) / sizeof (TCHAR)) ;::MessageBeep (MB_ICONEXCLAMATION) ;::MessageBox (NULL, szErrorStr, TEXT ("MCI Error"), MB_OK | MB_ICONEXCLAMATION) ;}return error == 0 ;}voidCTestMciDlg::OnBnClickedButton1()//播放{if (!mciExecute (TEXT ("open record3.wav alias mysound")))return;mciExecute (TEXT ("play mysound")) ;}voidCTestMciDlg::OnBnClickedButton2()//录音{// Delete existing waveform fileDeleteFile (TEXT ("record3.wav"));// Open waveform audio and recordif (!mciExecute (TEXT ("open new type waveaudio alias mysound")))return;mciExecute (TEXT ("record mysound")) ;// Enable and disable buttons}voidCTestMciDlg::OnBnClickedButton3()//停止{mciExecute (TEXT ("stop mysound")) ;mciExecute (TEXT ("save mysound record3.wav")) ;mciExecute (TEXT ("close mysound")) ;}

qwe123321 发表于 2015-8-21 20:55:11

xccvbndccn

heiben 发表于 2017-5-25 14:28:51

很好,谢谢。。每天都来小七论坛学习取经。
页: [1]
查看完整版本: 轻松实现音频录制播放等等功能