我想使用现有的音频文件创建一个音频文件,通过它我可以在文件的不同持续时间修改音频的音高。就像文件是 36 秒一样,那么我想用一些值修改第 1 2 秒的音高,然后从第 6 秒到第 9 秒修改一些其他值,依此类推。
基本上,我正在尝试根据用户提供的文本消息修改音频文件,比如用户输入“kill bill”,根据消息 k、i、l、b 中的每个字符......我已经采用了一个数组它存储不同的持续时间,就像我有 26 个字母表 a,b,c,d,... 等等。基于这些持续时间,我正在尝试针对这些特定持续时间修改文件。问题是我对音频的实际操作不是很好,我什至在 Java 中尝试过同样的操作,但无法这样做。
是否有一些其他参数可以在音频文件中更改而不会使更改变得非常明显?
我指的是这些值,虽然代码是用 Java 编写的,但请忽略它。稍后我将在 Python 中对其进行转换。值以毫秒为单位。
public static void convertMsgToAudio(String msg){
int len = msg.length();
duration = new double[len];
msg = msg.toUpperCase();
System.out.println("Msg 2 : " + msg);
int i;
//char ch;
for(i=0;i<msg.length();i++){
if(msg.charAt(i) == 'A'){
duration[i] = 50000;
}
else if (msg.charAt(i) == 'B'){
duration[i] = 100000; // value in milliseconds
}
else if (msg.charAt(i) == 'C'){
duration[i] = 150000;
}
else if (msg.charAt(i) == 'D'){
duration[i] = 200000;
}
else if (msg.charAt(i) == 'E'){
duration[i] = 250000;
}
else if (msg.charAt(i) == 'F'){
duration[i] = 300000;
}
else if (msg.charAt(i) == 'G'){
duration[i] = 350000;
}
else if (msg.charAt(i) == 'H'){
duration[i] = 400000;
}
else if (msg.charAt(i) == 'I'){
duration[i] = 450000;
}
else if (msg.charAt(i) == 'J'){
duration[i] = 500000;
}
else if (msg.charAt(i) == 'K'){
duration[i] = 550000;
}
else if (msg.charAt(i) == 'L'){
duration[i] = 600000;
}
else if (msg.charAt(i) == 'M'){
duration[i] = 650000;
}
else if (msg.charAt(i) == 'N'){
duration[i] = 700000;
}
else if (msg.charAt(i) == 'O'){
duration[i] = 750000;
}
else if (msg.charAt(i) == 'P'){
duration[i] = 800000;
}
else if (msg.charAt(i) == 'Q'){
duration[i] = 850000;
}
else if (msg.charAt(i) == 'R'){
duration[i] = 900000;
}
else if (msg.charAt(i) == 'S'){
duration[i] = 950000;
}
else if (msg.charAt(i) == 'T'){
duration[i] = 1000000;
}
else if (msg.charAt(i) == 'U'){
duration[i] = 1100000;
}
else if (msg.charAt(i) == 'V'){
duration[i] = 1200000;
}
else if (msg.charAt(i) == 'W'){
duration[i] = 1300000;
}
else if (msg.charAt(i) == 'X'){
duration[i] = 1400000;
}
else if (msg.charAt(i) == 'Y'){
duration[i] = 1500000;
}
else if (msg.charAt(i) == 'Z'){
duration[i] = 1600000;
}
}
}
现在,我正在尝试在 Python 中做同样的事情。我对这个概念很陌生,但这是我第一次面临这个概念的问题。