フィルターのクリア

pass a command to cmd

3 ビュー (過去 30 日間)
Sonima
Sonima 2021 年 11 月 10 日
コメント済み: DGM 2021 年 11 月 12 日
Hi all,
I want to append several mp3 files using cmd. Files are under different folder, so I need to first swith to the path:
cd /b E:\Voice\Folder 01
Then need to exclude the following:
copy /b 1.mp3+2.mp3+3.mp3+4.mp3 All.mp3
To append all mp3 files to a single file.
Does anyone know how can I do that?
Thanks.
  4 件のコメント
Walter Roberson
Walter Roberson 2021 年 11 月 12 日
The depths of my memory are saying that mp3 files were defined in a way that you can concatentate them. mp3 is a container format, and the music chunks are identified within the container, so the question becomes whether the reader will stop at the end of the "first" container. mp3 container does not assume that there is only one music chunk in a file.
DGM
DGM 2021 年 11 月 12 日
I've done it before and it usually works when the files are similar, but as you said, it depends on the reader and it seems to depend on the files being concatenated. If I concatenate a file with itself, Totem plays both segments fine. If I pick two files with differing bitrate or other options, Totem may or may not pick up the second segment. Similar happens with Audacious, though sometimes it displays incorrect track times when it does succeed.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 11 月 11 日
Use dir() to get the names of all of the mp3 files in the directory. Use natsortdir() from the File Exchange to sort them into numeric order -- most of the time dir() will tell you that the file after 1.bmp is 11.bmp and 2.bmp is not in the list until after 19.bmp and you need to rearrange the entries.
Then pull out the sorted names, and strjoin() them with '+' character. You can then use sprintf() to put together a command to pass to system()

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by