能不能用c或者是c++语句打开音频文件啊?

来源:百度知道 编辑:UC知道 时间:2024/05/26 02:33:54
不用vc

只能读入,但不能播放,播放要用库函数或用MFC

可以的,我帮你写了个音频文件的复制程序。。
#include<iostream>
#include<fstream>
#include<stdio.h>
using namespace std;
int main()
{
char ch;
ifstream in("C:\\走西口.mp3",ios::in|ios::binary);
if(!in)
{
cout<<"文件打开出错"<<endl;
exit(1);
}
ofstream out("F:\\jhf.mp3",ios::out|ios::binary);
if(!out)
{
cout<<"文件打开出错"<<endl;
exit(1);
}
while(in.good())
{
ch=in.get();
out.put(ch);
}
in.close();
out.close();
return 0;

}