阅读:1322回复:6
声音驱动问题!
各位大侠:为什么我的音频驱动不能控制声量的大小,付部分代码:
void WaveOutGetVolume(PDWORD pVolume) { RETAILMSG(TRUE/*MSG_TRACE*/, (TEXT(\"WaveGetVolume: pVolume = 0x%x\\r\\n\"), pVolume)); *pVolume = gVolume; } void WaveOutSetVolume(DWORD volume) { DWORD attenuation; // store the volume setting in a global gVolume = volume; // set the audio output attenuation // range is from 16 = full volume (no attenuation) to 0 = mute (full attenuation) attenuation = (volume >> 12) & 0x0F; // convert to a volume attenuation (0dB -- -60dB) attenuation = 32 - ((attenuation * 32) / 15); // message the details of the new volume setting RETAILMSG(TRUE/*MSG_TRACE*/, (TEXT(\"WaveSetVolume: attenuation = %d, volume = 0x%x,gVolume = 0x%x\\r\\n\"), attenuation, volume,gVolume)); SetVolume(AUDIO_AC97_MASTER_VOLUME_OFFSET, attenuation); } |
|
沙发#
发布于:2003-08-05 08:33
DDK的例子在DDK中。AC\'97是intel公司的标准。它的端口说明可以在intel网站找到。现在的设备都能自动进行大批量数据处理,ac\'97也不例外。intel的芯片组一般都集成了ac\'97。音频和视频的操作主要是同步问题,怎么把一块数据按要求的时间发往音频设备。你要直接汇编操纵ac\'97的话,就的先学它的数据结构,毕竟现在的硬件智能化多了。
|
|
板凳#
发布于:2003-08-02 13:40
DDK的例子是不是要到网上去找啊,哪位能够具体指点一下一般要改什么寄存器啊?
|
|
地板#
发布于:2003-07-29 12:59
驱动程序也是程序,也是人写的。去看DDK的例子吧。有intel ac \'97的例子,还不错。
|
|
地下室#
发布于:2003-07-28 10:38
真正的音频驱动是怎样写的,望各位赐教,最好有例子代码,多谢。
|
|
5楼#
发布于:2003-07-27 11:34
感觉你这不像是驱动,而像是DirectSound Sample.
|
|
6楼#
发布于:2003-07-26 17:45
你会写音频驱动?
|
|
|