My build of nnn with minor changes
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

37 lignes
942 B

  1. #!/usr/bin/env sh
  2. # Description: Create an mp3 ringtone out of an audio file in any format
  3. # Needs user to provide start and end where to cut the file
  4. # Input file audio.ext results in audio_ringtone.mp3
  5. #
  6. # Tip: To convert a complete media file, set start as 0 and
  7. # the runtime of the file as end.
  8. #
  9. # Requires: date, ffmpeg
  10. #
  11. # Shell: POSIX compliant
  12. # Author: Arun Prakash Jana
  13. if [ -n "$1" ]; then
  14. printf "start (hh:mm:ss): "
  15. read -r start
  16. st=$(date -d "$start" +%s) || exit 1
  17. printf "end (hh:mm:ss): "
  18. read -r end
  19. et=$(date -d "$end" +%s) || exit 1
  20. if [ "$st" -ge "$et" ]; then
  21. printf "error: start >= end "
  22. read -r _
  23. exit 1
  24. fi
  25. interval=$(( et - st ))
  26. outfile=$(basename "$1")
  27. outfile="${outfile%.*}"_ringtone.mp3
  28. ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
  29. fi