企业即时通讯 - Enterprise Instant Messenger

局域网聊天工具,文字讯息、文件发送、语音通讯、高清视频通讯、远程桌面控制。

用户操作
[即时聊天] [发私信] [加为好友]
FreeEIM StudioID:i_like_cpp
972412次访问,排名32,好友4人,关注者7人。
i_like_cpp的文章
原创 888 篇
翻译 4 篇
转载 69 篇
评论 1148 篇
FreeEIM Studio的公告
最近评论
ScanerKi:#include <stdio.h>

int asm(int s)
{
int t=0;
__asm
{
mov eax, DWORD PTR [ebp+8] ;把s的值传给eax
mov t, eax ;把eax的值传给t
}
printf("- %d……
li_delong:谢谢
li_delong:谢谢
li_delong:谢谢
XUETUJIAN:
文章分类
收藏
相册
EIM 截图
相关软件图片
PI的最精确值
FreeEIM 标签
FreeEIM华军下载
XP SP2 SDK
下载FreeEIM
盛天龙
飞鸽传书
不错的网站
CPPBLOG
局域网聊天
泡妞专家
用VC写Assembly代码(RSS)
百度的Blog(RSS)
存档
软件项目交易
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
订阅到BlogLines
订阅到Yahoo
订阅到GouGou
订阅到飞鸽
订阅到Rojo
订阅到newsgator
订阅到netvibes

转载 How to play and record sounds收藏

新一篇: 揭秘也门仆人阶层:没食物时吃亲人尸体 | 旧一篇: recording and play using Waveform audio interface

 

Introduction

This is a simple application that shows you how to play and record sound under windows.
It uses the old multimedia API. A better solution may be to use DirectSound.

Quick Guide to the Code

Start with the two functions in CFisterDlg called OnPlay and OnRecord. Follow them down to the depth you need to use the classes.

Short description

CSoundIn is a wrapper class that will let you retreive sound from the soundcard. The main functions are Start() and Stop()

CSoundOut is a wrapper class that will let you play sound on the soundcard. The main functions are Start() and Stop()

CSoundFile is a wrapper class of a single wave file, it can either be a file reader or a file writer object. See the constructor.

CSoundBase is a very small class that encapsulates the wave format.

CBuffer is a very small class that encapsulates a simple one dimentional buffer.

The project has a number of different callback functions:

  • One callback function makes the Play button change it's label to stop when it has finished playing the file. CDialogDlg enherits CPipe and overloads a function that CPipe can call when it has finished playing the wave file.
  • Another callback function make it possible for CSoundIn to callback to CPipe when it has filled the input buffer. Thus CPipe can give CSoundIn a new buffer to fill.
  • A clone of the above principle is also used in CSoundOut, which enables it to callback to the owner when it is finished playing the sound in a given buffer.

Problems that I encountered

I have spent almost 2 days debugging the following stupid problem. When CSoundIn and CSoundOut inherit from CSoundBase and CWinThread the order in which they are listed must be as shown below. If not, the callback functions, which are started by the WinThread message handler, will not be able to access the member variables of the CSoundIn object.

class CSoundIn : public CWinThread, public CSoundBase

During these two days of fustration I also tried to implement the callback as regular callback functions called by the device driver. This is possible using ::waveInOpen(...). But since this callback function is not allowed to call any of the ::waveInXXX(...) functions it is not of much use.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

 

发表于 @ 2008年02月21日 11:06:00|评论(loading...)|编辑

新一篇: 揭秘也门仆人阶层:没食物时吃亲人尸体 | 旧一篇: recording and play using Waveform audio interface

评论:没有评论。

发表评论  


登录
Csdn Blog version 3.1a
Copyright © FreeEIM Studio