Parallel iterator bash script. The Python files are empty ones, just a placeholder for the code they will host.

Sample audio files for the APM quality assessment toolbox

BUG=webrtc:7218
NOTRY=True

Review-Url: https://codereview.webrtc.org/2711923002
Cr-Commit-Position: refs/heads/master@{#16827}
This commit is contained in:
alessiob
2017-02-24 05:32:21 -08:00
committed by Commit bot
parent 7a1798d637
commit 306d1bfec0
10 changed files with 173 additions and 0 deletions

View File

@ -469,6 +469,7 @@ if (rtc_include_tests) {
":audioproc_f",
":audioproc_unittest_proto",
":unpack_aecdump",
"test/py_quality_assessment",
]
}
}

View File

@ -0,0 +1,66 @@
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("../../../../webrtc.gni")
copy("py_quality_assessment") {
testonly = true
sources = [
"README.md",
"apm_quality_assessment-export.py",
"apm_quality_assessment-gencfgs.py",
"apm_quality_assessment.py",
"apm_quality_assessment.sh",
]
outputs = [
"$root_build_dir/py_quality_assessment/{{source_file_part}}",
]
deps = [
":apm_configs",
":lib",
":output",
"../..:audioproc_f",
"//resources/audio_processing/test/py_quality_assessment:probing_signals",
]
} # py_quality_assessment
copy("lib") {
testonly = true
sources = [
"quality_assessment/__init__.py",
]
visibility = [ ":*" ] # Only targets in this file can depend on this.
outputs = [
"$root_build_dir/py_quality_assessment/quality_assessment/{{source_file_part}}",
]
deps = [
"//resources/audio_processing/test/py_quality_assessment:noise_tracks",
]
} # lib
copy("apm_configs") {
testonly = true
sources = [
"quality_assessment/apm_configs/default.json",
]
visibility = [ ":*" ] # Only targets in this file can depend on this.
outputs = [
"$root_build_dir/py_quality_assessment/apm_configs/{{source_file_part}}",
]
} # apm_configs
copy("output") {
testonly = true
sources = [
"output/README.md",
]
visibility = [ ":*" ] # Only targets in this file can depend on this.
outputs = [
"$root_build_dir/py_quality_assessment/output/{{source_file_part}}",
]
} # output

View File

@ -0,0 +1,10 @@
**APM Quality Assessment tool**
Python wrapper of audioproc_f with which quality assessment can be automatized.
The tool allows to simulate different noise conditions, input signals, APM
configurations and it computes different scores.
Once the scores are computed, the results can be easily exported to an HTML page
which allows to listen to the APM input and output signals and also the
reference one used for evaluation.
IMPORTANT: **the whole code has not been landed yet.**

View File

@ -0,0 +1,8 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

View File

@ -0,0 +1,8 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

View File

@ -0,0 +1,8 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

View File

@ -0,0 +1,63 @@
#!/bin/bash
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
# Customize probing signals, noise sources and scores if needed.
PROBING_SIGNALS=(py_quality_assessment/probing_signals/*.wav)
NOISE_SOURCES=( \
"identity" \
"white" \
"environmental" \
"echo" \
)
SCORES=( \
"polqa" \
"audio_level" \
)
OUTPUT_PATH=output
# Generate standard APM config files.
chmod +x apm_quality_assessment-gencfgs.py
./apm_quality_assessment-gencfgs.py
# Customize APM configurations if needed.
APM_CONFIGS=(py_quality_assessment/apm_configs/*.json)
# Add output path if missing.
if [ ! -d ${OUTPUT_PATH} ]; then
mkdir ${OUTPUT_PATH}
fi
# Start one process for each "probing signal"-"noise source" pair.
chmod +x apm_quality_assessment.py
for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do
probing_signal_name="$(basename $probing_signal_filepath)"
probing_signal_name="${probing_signal_name%.*}"
for noise_source_name in "${NOISE_SOURCES[@]}" ; do
LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"`
`"${noise_source_name}.log"
echo "Starting ${probing_signal_name} ${noise_source_name} "`
`"(see ${LOG_FILE})"
./apm_quality_assessment.py \
-i ${probing_signal_filepath}\
-o ${OUTPUT_PATH} \
-n ${noise_source_name} \
-c "${APM_CONFIGS[@]}" \
-e "${SCORES[@]}" > $LOG_FILE 2>&1 &
done
done
# Join.
wait
# Export results.
./apm_quality_assessment-export.py -o ${OUTPUT_PATH}
# Show results in the browser.
RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)"
sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 &

View File

@ -0,0 +1 @@
You can use this folder for the output generated by the apm_quality_assessment scripts.

View File

@ -0,0 +1,7 @@
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.