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.
 
 
 
 
 
 

32 lignes
791 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. # Requires: date, ffmpeg
  6. #
  7. # Shell: POSIX compliant
  8. # Author: Arun Prakash Jana
  9. if [ -n "$1" ]; then
  10. echo -n "start (hh:mm:ss): "
  11. read start
  12. st=$(date -d "$start" +%s) || exit 1
  13. echo -n "end (hh:mm:ss): "
  14. read end
  15. et=$(date -d "$end" +%s) || exit 1
  16. if [ $st -ge $et ]; then
  17. echo "error: start >= end"
  18. exit 1
  19. fi
  20. interval=$(( $et - $st ))
  21. outfile=$(basename "$1")
  22. outfile="${outfile%.*}"_ringtone.mp3
  23. ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
  24. fi