How to concatenate multiple .wav files from a list in R?

你说的曾经没有我的故事 提交于 2020-07-06 12:34:09

问题


I have a list of .wav files my_list:

library(seewave)
library(tuneR)
data(tico)
audio <- tico
freq <- 22050
breaks <- c(0,0.2,0.4,0.6,0.8)
index <- 1:(length(breaks)-1)
my_list<-lapply(index, function(i) audio[(breaks[i]*freq):(breaks[i+1]*freq)])

I want too combine all these files into 1 .wav file, but this doesn't work:

index <- 1:length(breaks) 
allf =lapply(index, function(i) bind(my_list[[i]]))

And this is too tedious to do since I have hundreds of multiple files to create:

allf =bind(my_list[[1]],my_list[[2]],my_list[[3]], my_list[[4]])

来源:https://stackoverflow.com/questions/41252351/how-to-concatenate-multiple-wav-files-from-a-list-in-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!