本文介绍了使用SoX将mp3文件拆分为TIME秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将mp3文件拆分为每个 TIME 秒.我尝试了mp3splt,但是如果输出少于1分钟,则对我来说不起作用.是否可以这样做:

I need to split mp3 file into slices TIME sec each. I've tried mp3splt, but it doesn't work for me if output is less than 1 minute.Is it possible do do with:

sox file_in.mp3 file_out.mp3 trim START LENGTH

当我不知道mp3文件时 LENGTH

When I don't know mp3 file LENGTH

推荐答案

您可以像这样运行SoX:

You can run SoX like this:

sox file_in.mp3 file_out.mp3 trim 0 15 : newfile : restart

它将创建一系列文件,每个文件包含15秒的音频. (显然,您可以指定15以外的其他值.)无需知道总长度.

It will create a series of files with a 15-second chunk of the audio each. (Obviously, you may specify a value other than 15.) There is no need to know the total length.

请注意,SoX与mp3splt不同,将对音频进行解码和重新编码(请参见世代丢失) .您应该确保至少使用SoX 14.4.0,因为以前的版本存在一个错误,即在块之间丢失了音频.

Note that SoX, unlike mp3splt, will decode and reencode the audio (see generation loss). You should make sure to use at least SoX 14.4.0 because previous versions had a bug where audio got lost between chunks.

这篇关于使用SoX将mp3文件拆分为TIME秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 15:01