I am trying to create a shell script in Linux that when executed searches a directory for all media files then creates a playlist and plays it with MPlayer.
How can I create an MPlayer playlist with a shell script? [closed]
When faced with a task like this, typically you will want to break it down into steps. Which part have you done so far? (1) Search a directory for all files. (2) Select the media files from a list of files. (3) Create a playlist file from the list of media files. (4) Start mplayer with the given playlist. –
Mazer
i Search the directory for the files –
Blackmun
not sure how to create the playlist n start mplayer –
Blackmun
OK I FIGURED IT OUT THANKS ANYWAYS –
Blackmun
Use this command :
find /PATH/TO/MUSIC/DIRECTORY/ -type f -iname "*.mp3" > playlist.m3u
Now play with mplayer :
mplayer -playlist playlist.m3u
add "sort" to the find, otherwise it won't add the playlist in the right order: find /PATH/TO/MUSIC/DIRECTORY/ -type f -iname "*.mp3" | sort > playlist.m3u –
Angloirish
© 2022 - 2024 — McMap. All rights reserved.