C# 如何控制麦克风与扬声器的音量

雨师88 2010-12-30 01:38:35
如何用程序控制麦克风和扬声器的音量呢
...全文
688 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
July_23 2010-12-31
  • 打赏
  • 举报
回复
要用系统API
jcx396158820 2010-12-31
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 jorln 的回复:]
调API是必须的···
参考http://hi.baidu.com/winson08/blog/item/7777faa62156039dd14358a7.html
[/Quote]
+1
zhouxingyu896 2010-12-30
  • 打赏
  • 举报
回复
www.codeproject.com
这个网站有实例,楼主可以看看
调用API
sxldfang 2010-12-30
  • 打赏
  • 举报
回复
没删干净,下面的函数就别看啦!

public int Volume // 音量 0 ~ 1000
sxldfang 2010-12-30
  • 打赏
  • 举报
回复



using System;
using System.Runtime.InteropServices;
using System.Text;
using System.IO;


namespace Mp3Player
{
class mciAudioPlay
{
[DllImport("winmm.dll", EntryPoint = "waveOutSetVolume", CharSet = CharSet.Auto)]
public static extern int waveOutSetVolume(uint deviceID, uint Volume); //参数为uint

public int Volume // 音量 0 ~ 1000
{
get
{
errCode = mciSendString("status music volume", buff, buff.Length, 0);
int p = buff.IndexOf('\0');
string s = buff.Substring(0, p);
if (string.IsNullOrEmpty(s)) return 0;
return int.Parse(s);
}
set
{
errCode = mciSendString("setaudio music volume to " + value, buff, buff.Length, 0);
}
}

static public uint LeftRightVolume // 分别控制左右声道的音量
{
set
{
waveOutSetVolume(0, value); // 0xffffffff,高2字节控制右声道,低2字节控制左声道。
}
}

public void setLeftRightVolume(uint volume)
{
waveOutSetVolume(0, volume);
}

}
}

caitlin_yu 2010-12-30
  • 打赏
  • 举报
回复
getvolume
wuyq11 2010-12-30
  • 打赏
  • 举报
回复
直接放大波形
编写声卡驱动,直接使用驱动修改声卡输出功率
http://www.codeproject.com/KB/audio-video/CS_ToneGenerator.aspx
莫名其 2010-12-30
  • 打赏
  • 举报
回复
a466247623 2010-12-30
  • 打赏
  • 举报
回复
迷糊中
雨师88 2010-12-30
  • 打赏
  • 举报
回复
Become an expert in Bayesian Machine Learning methods using R and apply them to solve real-world big data problems About This Book Understand the principles of Bayesian Inference with less mathematical equations Learn state-of-the art Machine Learning methods Familiarize yourself with the recent advances in Deep Learning and Big Data frameworks with this step-by-step guide Who This Book Is For This book is for statisticians, analysts, and data scientists who want to build a Bayes-based system with R and implement it in their day-to-day models and projects. It is mainly intended for Data Scientists and Software Engineers who are involved in the development of Advanced Analytics applications. To understand this book, it would be useful if you have basic knowledge of probability theory and analytics and some familiarity with the programming language R. What You Will Learn Set up the R environment Create a classification model to predict and explore discrete variables Get acquainted with Probability Theory to analyze random events Build Linear Regression models Use Bayesian networks to infer the probability distribution of decision variables in a problem Model a problem using Bayesian Linear Regression approach with the R package BLR Use Bayesian Logistic Regression model to classify numerical data Perform Bayesian Inference on massively large data sets using the MapReduce programs in R and Cloud computing In Detail Bayesian Inference provides a unified framework to deal with all sorts of uncertainties when learning patterns form data using machine learning models and use it for predicting future observations. However, learning and implementing Bayesian models is not easy for data science practitioners due to the level of mathematical treatment involved. Also, applying Bayesian methods to real-world problems requires high computational resources. With the recent advances in computation and several open sources packages available in R, Bayesian modeling has become more

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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