我希望这是张贴这个和有人可以帮助的正确地方。C++中的音频操作
我是一名音乐技术专业的学生,我最近选择了学习C++,因为这对我的职业生涯了解编程语言有很大的帮助,特别是这个编程语言,因为它用于视频游戏行业。
反正到主题上。我想创建的是一个程序(使用C++),让用户加载一个16位线性PCM WAVE文件。然后我想操作该波形文件中的音频采样数据。我想要删除每个第n个样本或在某个参数(±10%)内随机化它们。然后把它写成一个新的WAVE文件。
我很熟悉WAVE文件和RIFF头文件的结构。此刻我也使用Xcode作为我的IDE(因为我的MacBook Pro是我的工作计算机),但是如果需要使用代码块,我可以在我的PC上编码。
所以简单地说,它应该显示类似这样的东西?我知道有这个错误,只是让你得到我后一个想法:
#include <iostream>
using namespace std;
class main() //function start
{
string fileinput; //variable
string outlocation; //variable
cout << "please type file path directory: \n \n";
cin >> fileinput; //navigate to file by typing
cout << "Where would you like to save new file? \n \n";
cin >> outlocation; //select output by typing
// Then all the maths and manipulation is done
cout << "Your file has been created at ";
cout << outlocation;
cout << "\n \n";
system("pause");
return 0;
}
是否有可能,如果在所有,这样做在Xcode?我需要什么库?我明白这不是简单的东西,所以任何帮助将不胜感激。
谢谢你的帮助和时间。
詹姆斯
是 - 这应该是很简单 - 你只需要一个合适的库内存WAV文件数据和原始PCM样本之间的转换。 – 2011-03-21 14:53:50