How to: Use Submix Voices:https://msdn.microsoft.com/en-us/library/windows/desktop/ee415794(v=vs.85).aspx

This topic shows you how you can set groups of voices to send their output to the same submix voice. This enables a single change to a submix voice to affect a whole group of voices.

这篇文章向你展示怎样设置一组声音,使它们的输出发送到同一个Submix Voice。这样能够实现一个Submix Voice一个改变能够影响一整组声音。

1.Create a submix
voice
 to which all of the game's sound effect voices will send.

创建一个全部游戏声效都会输出到此的Submix Voice:

IXAudio2SubmixVoice * pSFXSubmixVoice;
pXAudio2->CreateSubmixVoice(&pSFXSubmixVoice,1,44100,0,0,0,0);

2.Create an XAUDIO2_VOICE_SENDS structure
that contains a reference to the submix voice.

创建一个包括对Submix Voice引用的XAUDIO2_VOICE_SENDS结构体:
XAUDIO2_SEND_DESCRIPTOR SFXSend = {0, pSFXSubmixVoice};
XAUDIO2_VOICE_SENDS SFXSendList = {1, &SFXSend};

3.Pass the XAUDIO2_VOICE_SENDS structure
to new source voices as they are created.

当创建Source Voices的时候,将XAUDIO2_VOICE_SENDS结构体传递给它们:
IXAudio2SourceVoice* pSFXSourceVoice;
if( FAILED(hr = pXaudio2->CreateSourceVoice( &pSFXSourceVoice, (WAVEFORMATEX*)&wfx,
0, XAUDIO2_DEFAULT_FREQ_RATIO, pCallback, pSFXSendList, NULL ) ) )
return hr;

4.Apply changes to all sound effect voices by adjusting the submix voice.

通过调节Submix Voice,改变全部和它有关联的声效:

In this example, changing the volume of the submix voice with the SetVolume function
effectively changes the volume of all voices that output to it.

比如:使用SetVolume函数来改动Submix Voice的音量,能够有效得改变全部输出到它的voices的volume。
pSFXSubmixVoice->SetVolume(0.1);

交流QQ:1245178753

How to: Use Submix Voices的更多相关文章

  1. How to install more voices to Windows Speech?

    !!!WARNING!!! This involves manual edits to your registry. If you mess it up, don't blame me. Do at ...

  2. (转) [it-ebooks]电子书列表

    [it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...

  3. 后HTML5时代

    十二年前,无论多么复杂的布局,在我们神奇的table面前,都不是问题:十年前,阿捷的一本<网站重构>,为我们开启了新的篇章:八年前,我们研究yahoo.com,惊叹它在IE5下都表现得如此 ...

  4. [Erlang 0122] Erlang Resources 2014年1月~6月资讯合集

    虽然忙,有些事还是要抽时间做; Erlang Resources 小站 2014年1月~6月资讯合集,方便检索.      小站地址: http://site.douban.com/204209/   ...

  5. net-force.nl/steganography writeup

    做CTF题好长一段时间了,真的可以学到很多东西.这次,我们开启 net-force.nl 的 Steganography之旅,所谓的隐写术. level 801: Training - Can you ...

  6. webrtc中APM(AudioProcessing module)的使用2

    这个其实就是从Audio_processing.h中拿出来的. APM should be placed in the signal chain as close to the audio hardw ...

  7. 【VC++技术杂谈004】使用微软TTS语音引擎实现文本朗读

    本文主要介绍如何使用微软TTS语音引擎实现文本朗读,以及生成wav格式的声音文件. 1.语音引擎及语音库的安装 TTS(Text-To-Speech)是指文本语音的简称,即通过TTS引擎把文本转化为语 ...

  8. AssetBundle loading failed because.....已解决

    http://blog.csdn.net/ldghd/article/details/9632455 *****************************      一      ******* ...

  9. HTML中strong与b,em与i标签的区别

    先看效果 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <titl ...

随机推荐

  1. sqlserver还原3101

    1.出现错误"3101" 2.解决办法:删除数据库之后还原(有风险)或者获得数据库的独占访问权(用sql语句) 参考:https://www.2cto.com/database/2 ...

  2. 什么是JavaScript框架-------share

    摘要:现代网站和web应用程序趋向于依赖客户端的大量的javascript来提供丰富的交互.特别是通过不刷新页面的异步请求来返回数据或从服务器端的脚本(或数据系统)中得到响应.在这篇文章中,你将会了解 ...

  3. node如何导出数据成为excel格式

    node的应用方式,导出数据 首先,你要把数据库连接上,把你要导的数据表写出来 安装模块 $ npm install sequelize $ npm install mysql $ npm insta ...

  4. Shell读取一个表达式并计算其结果

    #!/bin/bash # 读取一个算数表达式并计算出结果 # 如果输入 # 5+50*3/20 + (19*2)/7 # 则结果为 # 17.929 read x printf "%.3f ...

  5. django下的framework

    可以创建个虚拟环境先,不过我没使用这个方式 virtualenv env source env/bin/activate ------ 退出: To exit the virtualenv envir ...

  6. python 简易计算器(只能计算加减乘除和括号)

    import re # 格式化字符串函数(消除一些错误的格式) def format_string(string): # 一系列的替换语句 string = string.replace(" ...

  7. linux下solr5.0.0环境搭建

    1解压 linux下解压命令 tar -zxvf solr-5.0.0.tgz 2启动 linux 系统 直接切换solr-5.0.0\bin 文件夹 执行 solr star -p 8983 (如果 ...

  8. C 的指针和内存泄漏

    引言 对于任何使用 C 语言的人,如果问他们 C 语言的最大烦恼是什么,其中许多人可能会回答说是指针和内存泄漏.这些的确是消耗了开发人员大多数调试时间的事项.指针和内存泄漏对某些开发人员来说似乎令人畏 ...

  9. 【尺取或dp】codeforces C. An impassioned circulation of affection

    http://codeforces.com/contest/814/problem/C [题意] 给定一个长度为n的字符串s,一共有q个查询,每个查询给出一个数字m和一个字符ch,你的操作是可以改变字 ...

  10. Codeforces936C. Lock Puzzle

    给个串,只能用操作shift x表示把后面x个字符翻转后放到串的前面.问s串怎么操作能变t串.n<=2000,操作次数<=6100. 打VP时这转来转去的有点晕... 可以想一种逐步构造的 ...