📄 wav采样率转换 - c-c++ - it者论坛.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0043)http://bbs.itzhe.cn/viewthread.php?tid=6065 -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>wav采样率转换 - C/C++ - IT者论坛</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<META
content=wav,采样率,转换,IT者,C#,Java,Delphi,ASP,PHP,ASP.NET,网站建设,.NET,VC,数据库,DB2,SQL2000,Oracle,Mysql,服务器,C,vs.net2005,网络,cgi,JSP,CSS,html,xml,rss,域名,Dreamwaver,Photoshop,Fireworks,flash
name=keywords>
<META
content=" IT者论坛 要把44.1khz的采样转换为8khz,下面是一位前辈的实现方法,但得出的结果是一个通道转换了,另一个通道失败,找不出原因,请高手帮我看一下。这个算法是每两个点插 ... "
name=description>
<META content="MSHTML 6.00.2900.5626" name=GENERATOR>
<META content=www.itzhe.cn name=author>
<META content="2001-2008 www.itzhe.cn" name=copyright>
<META content=True name=MSSmartTagsPreventParsing>
<META http-equiv=MSThemeCompatible content=Yes><LINK title=IT者论坛
href="http://bbs.itzhe.cn/archiver/" rel=archives><LINK
href="wav采样率转换 - C-C++ - IT者论坛.files/style_7_viewthread.css" type=text/css
rel=stylesheet><LINK href="wav采样率转换 - C-C++ - IT者论坛.files/style_7_common.css"
type=text/css rel=stylesheet>
<SCRIPT type=text/javascript>
var discuz_uid = 0;var IMGDIR = 'images/dz7';var attackevasive = '0';var gid = 0;var STYLEID = '7';
gid = parseInt('8');var fid = parseInt('11');var tid = parseInt('6065');
</SCRIPT>
<SCRIPT src="wav采样率转换 - C-C++ - IT者论坛.files/common.js"
type=text/javascript></SCRIPT>
<STYLE type=text/css>.headermenu {
BACKGROUND: #59bfd2; HEIGHT: 33px
}
.headermain {
PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: url(images/dz7/header.gif) #fff; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
.tophp {
CLEAR: both; DISPLAY: inline; LIST-STYLE-TYPE: none
}
.tophp LI {
FLOAT: right; WIDTH: 70px; LINE-HEIGHT: 28px; MARGIN-RIGHT: 8px
}
.tophp A {
DISPLAY: block; HEIGHT: 25px; TEXT-ALIGN: center
}
.tophp A:link {
BACKGROUND: #052959 no-repeat 0px 1px; COLOR: #fff; TEXT-DECORATION: none
}
.tophp A:visited {
BACKGROUND: #052959 no-repeat 0px 1px; COLOR: #fff; TEXT-DECORATION: none
}
.tophp LI A:hover {
FONT-WEIGHT: bold; BACKGROUND: url(images/dz7/mtabbg.gif) #fff; COLOR: #03264e; TEXT-DECORATION: none
}
</STYLE>
<STYLE>BODY {
BACKGROUND: url(images/dz7/back.jpg) #000000 no-repeat center top
}
</STYLE>
<SCRIPT language=JavaScript>
<!-- Hide
function killErrors() {
return true;
}
window.onerror = killErrors;
// -->
</SCRIPT>
</HEAD>
<BODY onkeydown="if(event.keyCode==27) return false;">
<DIV class=headermain style="HEIGHT: 97px">
<DIV class=header style="FLOAT: left"><A title=IT者论坛
href="http://bbs.itzhe.cn/index.php"><IMG alt=IT者论坛
src="wav采样率转换 - C-C++ - IT者论坛.files/logo.gif" border=0></A></DIV>
<TABLE style="FLOAT: right" cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD align=right width=78></TD>
<TD align=right width=10 height=25></TD>
<TD class=a06 align=middle width=468 height=26><FONT color=#555555><A
class=a06 href="http://bbs.itzhe.cn/index.php" target=_blank>HOME</A> | <A
class=a06 href="http://bbs.itzhe.cn/" target=_blank></A>|<A class=a06
href="javascript:window.external.addFavorite('','IT者论坛')">收藏</A></FONT></TD></TR>
<TR>
<TD colSpan=5 height=46><A href="http://blog.itzhe.cn/" target=_blank><IMG
height=60 src="wav采样率转换 - C-C++ - IT者论坛.files/blog.gif" width=468
border=0></A></TD>
<TR>
<TD width=597 colSpan=5>
<DIV style="FLOAT: left; WIDTH: 597px">
<UL class=tophp>
<LI><A href="http://www.itzhe.cn/browse/9/index.html"
target=_blank>操作系统</A> </LI>
<LI><A href="http://www.itzhe.cn/browse/2/index.html"
target=_blank>编程</A> </LI>
<LI><A href="http://www.itzhe.cn/index.html" target=_blank>IT资讯</A>
</LI></UL></DIV></TD></TR></TBODY></TABLE></DIV>
<DIV id=append_parent></DIV>
<DIV id=ajaxwaitid></DIV>
<CENTER>
<DIV style="MARGIN-TOP: 20px"><IMG
src="wav采样率转换 - C-C++ - IT者论坛.files/bg_top.gif"></DIV>
<DIV id=top>
<DIV class=wrap>
<DIV id=menu><SPAN class=avataonline><A
href="http://bbs.itzhe.cn/register.php">注册</A> <A
href="http://bbs.itzhe.cn/logging.php?action=login">登录</A> </SPAN><SPAN
class=frameswitch>
<SCRIPT type=text/javascript>
if(top == self) {
document.write('<a href="frame.php?frameon=yes" target="_top" class="frameon">分栏模式<\/a>');
} else {
document.write('<a href="frame.php?frameon=no" target="_top" class="frameoff">平板模式<\/a>');
}
</SCRIPT>
</SPAN>
<UL>
<LI><A href="http://bbs.itzhe.cn/member.php?action=list">会员</A> </LI>
<LI><A href="http://bbs.itzhe.cn/search.php?srchfid=11">搜索</A> </LI>
<LI><A href="http://bbs.itzhe.cn/tag.php">标签</A> </LI>
<LI class=dropmenu id=stats onmouseover=showMenu(this.id)><A
href="http://bbs.itzhe.cn/stats.php">统计</A> </LI>
<LI><A href="http://bbs.itzhe.cn/faq.php">帮助</A> </LI></UL></DIV>
<STYLE type=text/css>.defaultpost {
MIN-HEIGHT: 120px! important; HEIGHT: 120px
}
.signatures {
; HEIGHT: expression(signature(this)); max-height: 100px
}
</STYLE>
<SCRIPT src="wav采样率转换 - C-C++ - IT者论坛.files/viewthread.js"
type=text/javascript></SCRIPT>
<SCRIPT type=text/javascript>zoomstatus = parseInt(1);</SCRIPT>
<DIV id=foruminfo>
<DIV id=nav>
<DIV class=userinfolist>
<P><A href="http://bbs.itzhe.cn/index.php">IT者论坛</A> » <A
href="http://bbs.itzhe.cn/forum-11-1.html">C/C++</A> » wav采样率转换</P></DIV></DIV>
<DIV id=headsearch>
<FORM onsubmit="this.target='_blank';" action=search.php?srchtype=qihoo
method=post><INPUT type=hidden value=yes name=searchsubmit> <INPUT class=input
onmouseover="this.focus();this.value='';this.onmouseover=null;"
style="BACKGROUND: #fff" onfocus=this.select() size=27 name=srchtxt>
<BUTTON type=submit>搜索</BUTTON> </FORM></DIV></DIV>
<DIV id=ad_text></DIV>
<DIV class=pages_btns>
<DIV class=threadflow><A
href="http://bbs.itzhe.cn/redirect.php?fid=11&tid=6065&goto=nextoldset">‹‹
上一主题</A> | <A
href="http://bbs.itzhe.cn/redirect.php?fid=11&tid=6065&goto=nextnewset">下一主题
››</A></DIV><SPAN class=postbtn id=newspecial
onmouseover="$('newspecial').id = 'newspecialtmp';this.id = 'newspecial';showMenu(this.id)"><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra="><IMG
title=发新话题 alt=发新话题 src="wav采样率转换 - C-C++ - IT者论坛.files/newtopic.gif"
border=0></A></SPAN> <SPAN class=replybtn><A
href="http://bbs.itzhe.cn/post.php?action=reply&fid=11&tid=6065&extra="><IMG
alt="" src="wav采样率转换 - C-C++ - IT者论坛.files/reply.gif" border=0></A></SPAN></DIV>
<UL class="popupmenu_popup newspecialmenu" id=newspecial_menu
style="DISPLAY: none">
<LI><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=">发新话题</A>
</LI>
<LI class=poll><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=&special=1">发布投票</A>
</LI>
<LI class=trade><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=&special=2">发布商品</A>
</LI>
<LI class=reward><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=&special=3">发布悬赏</A>
</LI>
<LI class=activity><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=&special=4">发布活动</A>
</LI>
<LI class=debate><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=&special=5">发布辩论</A>
</LI>
<LI class=video><A
href="http://bbs.itzhe.cn/post.php?action=newthread&fid=11&extra=&special=6">发布视频</A>
</LI></UL>
<FORM name=modactions method=post><INPUT type=hidden value=54526f3d
name=formhash>
<DIV class="mainbox viewthread"><SPAN class=headactions><A class=notabs
href="http://bbs.itzhe.cn/viewthread.php?action=printable&tid=6065"
target=_blank>打印</A> </SPAN>
<H1>wav采样率转换 </H1>
<TABLE id=pid45773 cellSpacing=0 cellPadding=0 summary=pid45773>
<TBODY>
<TR>
<TD class=postauthor><CITE><A class=dropmenu id=userinfo45773
onmouseover=showMenu(this.id) href="http://bbs.itzhe.cn/space-uid-20.html"
target=_blank>kakashi5240</A></CITE>
<DIV class=avatar><IMG
onerror="this.onerror=null;this.src='http://uc.itzhe.cn/images/noavatar_middle.gif'"
src=""></DIV>
<P><EM>新手上路</EM></P>
<P><IMG alt="Rank: 1"
src="wav采样率转换 - C-C++ - IT者论坛.files/star_level1.gif"></P>
<UL>
<LI class=pm><A onclick="pmwin('open', 'uid=20')"
href="http://bbs.itzhe.cn/viewthread.php?tid=6065###">发短消息</A> </LI>
<LI class=buddy><A id=ajax_buddy_0
onclick="ajaxmenu(event, this.id, 3000, 0)"
href="http://bbs.itzhe.cn/my.php?item=buddylist&newbuddyid=20&buddysubmit=yes"
target=_blank>加为好友</A> </LI>
<LI class=offline>当前离线 </LI></UL></TD>
<TD class=postcontent>
<DIV class=postinfo><STRONG id=postnum45773 title=复制帖子链接到剪贴板
onclick="setcopy('http://bbs.itzhe.cn/viewthread.php?tid=6065&page=1#pid45773', '帖子链接已经复制到剪贴板')">1<SUP>#</SUP></STRONG>
<EM onclick="$('postmessage_45773').className='t_bigfont'">大</EM> <EM
onclick="$('postmessage_45773').className='t_msgfont'">中</EM> <EM
onclick="$('postmessage_45773').className='t_smallfont'">小</EM> 发表于
2007-12-5 13:46 <A
href="http://bbs.itzhe.cn/viewthread.php?tid=6065&page=1&authorid=20"
rel=nofollow>只看该作者</A> </DIV>
<DIV class=ad_textlink2 id=ad_thread2_0><A
href="http://www.waihuiqun.com/" target=blank
?><B>外汇群-最专业的中文外汇网站</B></FONT></A></DIV>
<DIV class="postmessage defaultpost">
<DIV class=ad_pip id=ad_thread3_0>
<SCRIPT type=text/javascript>
cpro_client='itzhe_cpr';
cpro_cbd='#trans';
cpro_cbg='#trans';
cpro_ctitle='#0000ff';
cpro_cdesc='#444444';
cpro_curl='#008000';
cpro_cflush='#e10900';
cpro_at='text_image';
cpro_161=9;
cpro_flush=2;
cpro_81=0;
cpro_uap=1;
cpro_w=250;
cpro_h=250;
cpro_template='text_pages_250_250';
cpro_channel=4161;
</SCRIPT>
<SCRIPT language=JavaScript src="wav采样率转换 - C-C++ - IT者论坛.files/cp.js"
type=text/javascript></SCRIPT>
</DIV>
<DIV id=ad_thread4_0></DIV>
<H2>wav采样率转换</H2>
<DIV class=t_msgfont
id=postmessage_45773>要把44.1khz的采样转换为8khz,下面是一位前辈的实现方法,但得出的结果是一个通道转换了,另一个通道失败,找不出原因,请高手帮我看一下。这个算法是每两个点插入80个值,这80个点的值由这两个点的斜率算出,原先的441个点就变成441×80个点,每441个点取一次值就转换为80个值的采样。
这种算法效果不太好,有没有更好的算法?
while(datasize&gt; 0) {
fread(&data2[0],2,441,pcmfile);
datasize=datasize-2*441;
for(i=0;i
&lt;maxsize;i =80)
{
data<I>=data2[i/80];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -