Python wrapper for Xiph.org rnnoise ( https://gitlab.xiph.org/xiph/rnnoise )
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. INFILE=samples/bonjour.wav
  3. hr() {
  4. echo "$(printf "%0.s+" $(seq 80))"
  5. }
  6. hr
  7. echo "Running test_pyrnnoise.py"
  8. hr
  9. /usr/bin/env python3 test_pyrnnoise.py -vv || exit 1
  10. out_orig=$(mktemp -t out_XXXXXXXX.wav)
  11. out_1=$(mktemp -t out_XXXXXXXX.wav)
  12. out_2=$(mktemp -t out_XXXXXXXX.wav)
  13. clean_exit() {
  14. rm $out_orig $out_1 $out_2
  15. exit $1
  16. }
  17. hr
  18. echo "Functionnal test of rnnoise module against Xiph demo program"
  19. hr
  20. if [ ! -f 'rnnoise_demo' ]
  21. then
  22. echo "Compiling rnnoise_demo"
  23. gcc -o rnnoise_demo rnnoise_demo.c -lrnnoise || clean_exit 12
  24. fi
  25. echo "Running Xiph demo programm"
  26. python3 demo_orig.py "$INFILE" "$out_orig" || clean_exit 2
  27. echo "Running demo.py"
  28. python3 demo.py "$INFILE" "$out_2" || clean_exit 3
  29. if diff -rupN "$out_orig" "$out_2"
  30. then
  31. echo "demo.py [OK]"
  32. else
  33. echo "demo.py [fail]"
  34. fi
  35. echo "Running demo_iter.py"
  36. python3 demo_iter.py "$INFILE" "$out_1" || clean_exit 4
  37. if diff -rupN "$out_orig" "$out_1"
  38. then
  39. echo "demo_iter.py [OK]"
  40. else
  41. echo "demo_iter.py [fail]"
  42. fi
  43. clean_exit 0