directsound的一个简单问题

dqxian 2007-11-25 09:25:24
我想在播放音频的时候动态的改变播放的频率,应该调用什么函数?什么操作?
是不是调用IDirectSoundBuffer8::SetFrequency(Freq)函数呀?如果是的话
应该在什么地方加呢?是在往DirectSound Buffer添加数据(即Lock()函数前面)
还是在播放的时候m_pDSB->play(0,0,0)前面加?还有哪些参数要注意修改?
...全文
57 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hugeice 2007-11-25
  • 打赏
  • 举报
回复
以前用的时候好像是可以随时修改播放频率, 不过不能修改主缓冲的播放频率, MSDN上说的, 参见 http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/htm/idirectsoundbuffer8setfrequency.asp

Remarks

Increasing or decreasing the frequency changes the perceived pitch of the audio data. This method does not affect the format of the buffer.

Before setting the frequency, you should ascertain whether the frequency is supported by checking the dwMinSecondarySampleRate and dwMaxSecondarySampleRate members of the DSCAPS structure for the device. Some operating systems do not support frequencies greater than 100,000 Hz.

This method is not valid for the primary buffer.
dqxian 2007-11-25
  • 打赏
  • 举报
回复
哦,谢谢楼上的回复

2,543

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧