how to join mp3 in linux machine using php
I have this mp3 folder that contains mp3 generate from Google Text To Speech (TTS).
I using WinSCP to access the webserver which is using Linux.
Since the number of mp3 in this folder is not fix, i cant use this command to join the mp3 via php script.
cat file开发者_Python百科1.mp3 file2.mp3 > new_file1.mp3
This command works but it join the mp3 without the correct order.
cat *.mp3 > new_filename.mp3
Question is how to join the mp3 based on the date time it created? Or if i rename all the mp3 into 1.mp3 etc filename, i want it to be join based on the filename ascending.
ls -t | xargs cat > new_filename.mp3
Are you using FFMPEG or php (I'm not familar with php)?
http://ffmpeg.mplayerhq.hu/download.html
FFMPEG will do the job, here is the command to concatenate files:
cat output1.mpg output2.mpg output3.mpg > outputall.mpg
You have sth.mp3
sth.mp3
sth.mp3
... ok?
(time based: )
ls -lt | grep -i mp3 | awk '{ print $8}' | xargs > x cat
(time based (Reversed )
ls -ltr | grep -i mp3 | awk '{ print $8}' | xargs > x cat
精彩评论