我刚买了一张 CD,并将其编码为 FLAC,在 CD 的内页上,有一条注释,说为了以适当的音高水平体验音乐(这对于古典音乐来说很重要),音高必须调整 -3%,从而导致节奏同样降低,这也是合适的。如何在播放 .flac 文件时获得音高和速度的降低?通过 CLI 执行此操作会是一个优点,但不是必需的。
注意:不同于如何修改音频输出的音调?,Ubuntu 音频音调变换过滤器,如何控制Banshee的播放速度?,具有速度控制的音乐/播客播放器吗?或任何其他要求音调受影响但不影响速度或反之亦然的问题。另外,我并不是在问如何更改系统范围内的音频音调和速度。
答案1
- 如果你可以导入你的声音文件大胆,您将在“效果”菜单中看到“更改速度”功能:您可以将速度精确设置为 -100 到 +400 之间的任意百分比。
- 或者播放器和速度选项,命令行将是:
mplayer -speed 0.97 soundfile.mp3
答案2
我觉得大胆@laugeo 提到的选项不错,但不是你喜欢的 CLI。mplayer
选项是一个命令行,但不是永久的。
由于这实际上只影响一组文件,并且您不想在每次播放不需要此应用程序的其他文件时都要考虑更改这些因素,所以我认为最好只是将文件重新编码为可以正常播放的版本,而不必做一些特殊的事情。
您可以使用命令行工具sox
为您完成此任务。根据其手册页,speed
效果就会达到目的:
speed factor[c] Adjust the audio speed (pitch and tempo together). factor is either the ratio of the new speed to the old speed: greater than 1 speeds up, less than 1 slows down, or, if appended with the letter `c', the number of cents (i.e. 100ths of a semitone) by which the pitch (and tempo) should be adjusted: greater than 0 increases, less than 0 decreases.
因此对于每个文件你需要执行以下操作:
sox /path/to/input.flac /path/to/output.flac speed 0.97
如果你想疯狂地使用它,你可以尝试弄乱rate
效果,正如注释末尾提到的那样speed
:
Technically, the speed effect only changes the sample rate information, leaving the samples themselves untouched. The rate effect is invoked automatically to resample to the output sample rate, using its default quality/speed. For higher quality or higher speed resampling, in addition to the speed effect, specify the rate effect with the desired quality option.
rate
以下是为您总结的信息。
rate [-q|-l|-m|-h|-v] [override-options] RATE[k] Change the audio sampling rate (i.e. resample the audio) to any given RATE (even non-integer if this is supported by the output file format) using a quality level defined as follows:
Quality Band- Rej dB Typical Use
width
-q quick n/a ≈30 @ playback on
Fs/4 ancient hardware
-l low 80% 100 playback on old
hardware
-m medium 95% 100 audio playback
-h high 95% 125 16-bit mastering
(use with dither)
-v very high 95% 175 24-bit mastering
The simple quality selection described above provides settings that satisfy the needs of the vast majority of resampling tasks. Occasionally, however, it may be desirable to fine-tune the resampler's filter response; this can be achieved using override options, as detailed in the following table:
-M/-I/-L Phase response = minimum/intermediate/linear
-s Steep filter (band-width = 99%)
-a Allow aliasing/imaging above the pass-band
-b 74-99.7 Any band-width %
-p 0-100 Any phase response (0 = minimum, 25 = intermediate,
50 = linear, 100 = maximum)
因此,如果您想要最高标准质量和 48kHz 采样率,您的命令将增长为:
sox /path/to/input.flac /path/to/output.flac speed 0.97 rate -v 48k