OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 # |
| 4 # Use of this source code is governed by a BSD-style license |
| 5 # that can be found in the LICENSE file in the root of the source |
| 6 # tree. An additional intellectual property rights grant can be found |
| 7 # in the file PATENTS. All contributing project authors may |
| 8 # be found in the AUTHORS file in the root of the source tree. |
| 9 |
| 10 # Customize probing signals, noise sources and scores if needed. |
| 11 PROBING_SIGNALS=(py_quality_assessment/probing_signals/*.wav) |
| 12 NOISE_SOURCES=( \ |
| 13 "identity" \ |
| 14 "white" \ |
| 15 "environmental" \ |
| 16 "echo" \ |
| 17 ) |
| 18 SCORES=( \ |
| 19 "polqa" \ |
| 20 "audio_level" \ |
| 21 ) |
| 22 OUTPUT_PATH=output |
| 23 |
| 24 # Generate standard APM config files. |
| 25 chmod +x apm_quality_assessment-gencfgs.py |
| 26 ./apm_quality_assessment-gencfgs.py |
| 27 |
| 28 # Customize APM configurations if needed. |
| 29 APM_CONFIGS=(py_quality_assessment/apm_configs/*.json) |
| 30 |
| 31 # Add output path if missing. |
| 32 if [ ! -d ${OUTPUT_PATH} ]; then |
| 33 mkdir ${OUTPUT_PATH} |
| 34 fi |
| 35 |
| 36 # Start one process for each "probing signal"-"noise source" pair. |
| 37 chmod +x apm_quality_assessment.py |
| 38 for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do |
| 39 probing_signal_name="$(basename $probing_signal_filepath)" |
| 40 probing_signal_name="${probing_signal_name%.*}" |
| 41 for noise_source_name in "${NOISE_SOURCES[@]}" ; do |
| 42 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"` |
| 43 `"${noise_source_name}.log" |
| 44 echo "Starting ${probing_signal_name} ${noise_source_name} "` |
| 45 `"(see ${LOG_FILE})" |
| 46 ./apm_quality_assessment.py \ |
| 47 -i ${probing_signal_filepath}\ |
| 48 -o ${OUTPUT_PATH} \ |
| 49 -n ${noise_source_name} \ |
| 50 -c "${APM_CONFIGS[@]}" \ |
| 51 -e "${SCORES[@]}" > $LOG_FILE 2>&1 & |
| 52 done |
| 53 done |
| 54 |
| 55 # Join. |
| 56 wait |
| 57 |
| 58 # Export results. |
| 59 ./apm_quality_assessment-export.py -o ${OUTPUT_PATH} |
| 60 |
| 61 # Show results in the browser. |
| 62 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)" |
| 63 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 & |
OLD | NEW |