mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Merge pull request #299 from ath3/ringtone-fixes
Small ringtone plugin fixes
This commit is contained in:
commit
169b29029e
|
@ -8,14 +8,14 @@
|
||||||
# Shell: POSIX compliant
|
# Shell: POSIX compliant
|
||||||
# Author: Arun Prakash Jana
|
# Author: Arun Prakash Jana
|
||||||
|
|
||||||
if ! [ -z "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
echo -n "start (hh:mm:ss): "
|
echo -n "start (hh:mm:ss): "
|
||||||
read start
|
read start
|
||||||
st=`date -d "$start" +%s`
|
st=$(date -d "$start" +%s) || exit 1
|
||||||
|
|
||||||
echo -n "end (hh:mm:ss): "
|
echo -n "end (hh:mm:ss): "
|
||||||
read end
|
read end
|
||||||
et=`date -d "$end" +%s`
|
et=$(date -d "$end" +%s) || exit 1
|
||||||
|
|
||||||
if [ $st -ge $et ]; then
|
if [ $st -ge $et ]; then
|
||||||
echo "error: start >= end"
|
echo "error: start >= end"
|
||||||
|
@ -24,7 +24,7 @@ if ! [ -z "$1" ]; then
|
||||||
|
|
||||||
interval=$(( $et - $st ))
|
interval=$(( $et - $st ))
|
||||||
|
|
||||||
outfile=`basename "$1"`
|
outfile=$(basename "$1")
|
||||||
outfile="${outfile%.*}"_ringtone.mp3
|
outfile="${outfile%.*}"_ringtone.mp3
|
||||||
|
|
||||||
ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
|
ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
|
||||||
|
|
Loading…
Reference in a new issue