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.
 
 
 
 
 
 

31 lignes
736 B

  1. #!/usr/bin/env sh
  2. # Description: Read a text or PDF file in British English
  3. #
  4. # Shell: POSIX compliant
  5. # Author: Arun Prakash Jana
  6. if ! [ -z "$1" ]; then
  7. tmpf=`basename "$1"`
  8. tmpf="${TMPDIR:-/tmp}"/"${tmpf%.*}"
  9. if [ $(head -c 4 "$1") = "%PDF" ]; then
  10. # Convert using pdftotext
  11. pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' > "$tmpf".txt
  12. pico2wave -w "$tmpf".wav -l en-GB "$(cat "$tmpf".txt | tr '\n' ' ')"
  13. rm "$tmpf".txt
  14. else
  15. pico2wave -w "$tmpf".wav -l en-GB "$(cat "$1" | tr '\n' ' ')"
  16. fi
  17. # to jump around and note the time
  18. mpv "$tmpf".wav
  19. # flat read but better quality
  20. # play -qV0 "$tmpf".wav treble 2 gain -l 2
  21. rm "$tmpf".wav
  22. fi