我有一个大的声音文件(150 MB),我想分成一些更容易管理的大小文件,比如说有5分钟音频的文件.显然,最后一段将是<= 5分钟,那没关系.有没有办法轻松完成这类任务?
可以使用以下链接下载用于此问题的小样本.mp3文件:download.linnrecords.com/test/mp3/recit.aspx.
这是我到目前为止所尝试的.我使用readMP3from 导入数据tuneR并将使用该cutw函数,但是没有找到使用它的有效方法.
library(tuneR)
sample<-readMP3("recit.mp3")
# the file is only 9.04 seconds long (44.1 Hz, 16-bit, sterio)
# so, for this example we can cut it into 0.5 second intervals)
subsamp1<-cutw(sample, from=0, to=0.5, output="Wave")
# then I would have to do this for each interval up to:
subsampn<-cutw(sample, from=9, to=9.04, output="Wave")
# where I have to explicitly state the maximum second (i.e. 9.04),
# unless there is a way I don't …Run Code Online (Sandbox Code Playgroud)