RockAA Utilsのテストおよび使用の中国語/英語V1.0.0の内容を完成して下さい。 ソーススコープは、ArmSoM では、SOC、SDK/BSP、オーディオ I/O、ALSA デバイス、アルゴリズムライブラリバージョン/アベイラビリティの確認が必要なプラットフォームリファレンスです。 出典タイミング/負荷ログはArmSoM測定ではありません。 音声コマンドは実行されません。 技術的な数字がない場合、このソースは技術的にありません。
1. . プロフィール {#1-overview}
1.1 RockAAのユーティリティ機能の紹介 {#11-rockaa-utils-function-introduction}
RockAA(Rockchipオーディオアルゴリズム)ユーティリティは、メディアフレームワークを気にすることなくRockchipオーディオアルゴリズムの有効性を迅速に検証するのに役立ちます。 RockAA Utilsは、主に、小胞と小さな遊びのデザイン哲学に描かれています。 rockaa_capt とりあえず rockaa_play さまざまなコマンドパラメーターで異なる使用シナリオで検証するツール。 それらはすべて共通のライブラリに依存します librockaa.so . . . あと、 rockaa_capt 主にトークテストに使用され、 rockaa_play 主に、オーディオエフェクトのテスト、それらに依存するオーディオアルゴリズムライブラリを再生するために使用され、特定の依存関係は次の通りです。
rockaa_capt
├── librockaa.so # Common library for RockAA tools
├── libaec_bf_process.so # Acoustic Echo Cancellation algorithm library
└── librkaudio_common.so # Common audio algorithm library
rockaa_play
├── librockaa.so # Common library for RockAA tools
└── librkaudio_effect.so # Audio effect algorithm library
2. . 使用法 Scenarios の紹介 {#2-usage-scenarios-introduction}
現在の主な適用シナリオには、次のようなものがあります。 トークプレイバックエフェクト
2.1 オフラインファイルのテストを話します {#21-offline-file-talking-testing}
オーディオアルゴリズムをデバッグする前に、ほとんどの開発者は、特定の構造で量産モデルに事前にオーディオを収集し、このオーディオを固定音源入力として使用し、出力が期待されるオーディオデータを満たしているまで、アルゴリズムパラメータを調整および最適化します。
./rockaa_capt -I record.pcm -O out_talk.pcm -c 2 -C 1 -b 16 -r 16000 -Z 1 -F config_aivqe.json
このログは、オフラインファイルプロセスを介してテストを話している際の動作を示します。
[tagI] Capture via offline file process, in_file: record.wav
複数のキーパラメータの使用状況を分析してみましょう
"-I" is the only parameter for switching between offline file mode and real-time
online mode. If this parameter is included, it indicates operation in offline
file mode, with the following "record.pcm" representing the pre-recorded audio
source from the device that is ready for processing.
"-O out_talk.pcm" indicates the name of the PCM output after the audio algorithm
has been applied, which is a single channel with a sample rate and bit width
consistent with the "-b 16 -r 16000" specified later. If not specified, a default
PCM file starting with "TALK" will be generated;
"-c 2" indicates the total number of channels, "-C 1" indicates the number of
channels for the remote reference signal, and the number of channels for the
local MIC is the difference between them, such as in this example: "2-1=1", which
is a single MIC pickup scenario;
"-b 16 -r 16000" indicates the two basic PCM formats in addition to the number of
channels, with a 16-bit depth and a 16kHz sampling rate;
"-Z 1" indicates summary debug mode, which will provide a one-time summary of the
frame count, as well as the minimum, maximum, and average time consumption and
load after the test is completed:
[tagI] == frames:63, period_time:16000us, cost_time min:657us max:1375us
avg:793us, load min:4.11% max:8.59% avg:4.96% ==
"-Z 0" indicates that debug mode statistics are not enabled. "-Z 2" indicates
that time consumption and load statistics are performed for each frame. For
example:
[tagI] frame[1] period_time: 16000 us, cost_time: 942 us, load: 5.89%
[tagI] frame[2] period_time: 16000 us, cost_time: 808 us, load: 5.05%
[tagI] frame[3] period_time: 16000 us, cost_time: 858 us, load: 5.36%
"-Z 3" indicates a combination of the effects of "-Z 1" and "-Z 2", that is, load
is printed for each frame, and summary debug information is printed at the end.
...
"-F config_aivqe.json" indicates the JSON parameter configuration file for the
audio algorithm. If not specified, the program will exit directly with the
corresponding log prompt:
./rockaa_capt -I record.wav -O out_talk.pcm -c 2 -C 1 -b 16 -r 16000 -Z 1
input file: record.wav
[tagE] Can't support in_file: record.wav without conf file
2.2 リアルタイムオンライン・トークテスト {#22-real-time-online-talking-testing}
上記のように、 “-I” パラメータが含まれていない場合は、以前のオフラインファイルテストのパラメーターが良好な結果を達成し、テストはよりユーザーのような経験のためにリアルタイムオンラインモードに入ります。
./rockaa_capt record.wav -O out_talk.pcm -D 0 -d 0 -c 2 -C 1 -b 16 -r 16000 -Z 1 -F config_aivqe.json
このログはリアルタイムのオンライン・トークのテストで動作を示します。
[tagI] Capture via run-time process
ほとんどのパラメータは、前述のファイルオフラインテストと同じで、さまざまなパラメーターの追加の説明は次のとおりです。
"record.wav" is used here as the wav file format to save before audio algorithm
processing;
"-D 0 -d 0" comes from the concepts of TINYALSA and ALSA, indicating audio
capture from card0 and device0;
"-t 10" means recording for 10 seconds;
"-F config_aivqe.json" specifies the json parameter configuration file for the
audio algorithm. If not specified, it will work in bypass capture mode, similar
to tinycap, with corresponding log prompts. For example:
./rockaa_capt record.wav -D 0 -d 0 -c 2 -C 1 -b 16 -r 16000 -Z 1
[tagI] Not specify conf_path and capture raw pcm directly
2.3 オフラインの再生バックオーディオ効果テスト {#23-offline-playback-audio-effect-testing}
再生効果のシナリオをテストするために、開発者は、既存のオーディオソースを使用して、オフラインテストとパラメータチューニングのためにテストされるように、最初に「-I」パラメータを追加することもできます。
./rockaa_play -I speech_2ch.wav -O out_effect.pcm -p 256 -Z 1 -F config_playeffect.bin
このログはオフライン再生効果テストの動作を示します。
[tagI] Playback via offline file process, in_file: speech_2ch.wav
いくつかの重要なパラメーターの使用状況を分析してみましょう。
"-I" here still serves as the only parameter for switching between offline file
mode and real-time online mode. If this parameter is included, it indicates
operation in offline file mode, with the following "speech_2ch.wav" being the
pre-collected audio source ready for processing.
"-O out_effect.pcm" indicates the PCM name output after specifying the audio
algorithm, which is a single channel, with the sample rate and bit width
consistent with the later specified "-b 16 -r 16000". If not specified, it will
default to generate an output file starting with "EFFECTPLAY";
"-c -b -r" still indicates the three basic elements of PCM format, that is, the
number of channels, bit depth, and sample rate, which can be forcibly specified
as PCM format with the lowercase "-i raw". This example is a wav input,
automatically parsed and played according to the wav format;
"-p 256" means processing 256 sample points per frame, which at 16kHz is
256/16000=16ms per frame.
"-Z 0 -Z 1 -Z 2 -Z 3" have the same effect as the aforementioned rockaa_capt.
"-F config_playeffect.bin" indicates the specification of the sound effect
configuration file. If not specified, it will exit directly with the
corresponding log prompt:
./rockaa_play -I speech_2ch.wav -O out_effect.pcm -p 256 -Z 1
[tagE] Can't support in_file: speech_2ch.wav without conf file
2.4 リアルタイムオンラインオーディオエフェクト再生テスト {#24-real-time-online-audio-effect-playback-testing}
以前のオフラインファイルテストのパラメータが良好な結果を達成している場合は、リアルタイムオンラインオーディオ効果再生テストを入力するには「-I」パラメータを削除します。
./rockaa_play speech_2ch.wav -D 0 -d 0 -p 256 -Z 1 -F config_playeffect.bin
このログはリアルタイムのオンラインオーディオ効果再生テストで動作を示します。
[tagI] Playback via run-time process
ほとんどのパラメータは、 前述のものと同様に機能します。 今回「-F」パラメータが指定されていない場合、それは、sinyplayと同じ効果を持ち、対応するログプロンプトを持っているバイパス再生を意味します。 たとえば:
./rockaa_play speech_2ch.wav -D 0 -d 0 -p 256 -Z 1
[tagI] Not specify conf_path and playback raw pcm directly
3. . ヘルプ情報でもっと詳細な使用方法 {#3-more-detailed-usage-in-help-information}
rockaa_captのヘルプリスト:
# ./rockaa_capt
Usage: ./rockaa_capt [OPTION]...
-h, help
-v print current version
-b, bits of samples
-r, the sample rate for stream (default: 16000)
-c, the number of channels (default: 2)
-C, the number of far-end channels (default: 1)
-p, the size of per-period (default: 256)
-n, the number of periods (default: 4)
-t, capture time (default: UINT_MAX)
-a, enable DOA and return result (default: disabled)
-F, the path of json config file, without it capture raw pcm directly
-I, use offline input file mode, without capture via sound card
-Z, use debug mode, 0:disabled 1:summary 2:per-frame 3:summary+per-frame
(default: 0)
For example:
./rockaa_capt cap.wav -c 2 -C 1 -b 16 -r 16000 -t 10 -Z 1 -F config_aivqe.json
rockaa_playのヘルプリスト:
# ./rockaa_play
usage: ./rockaa_play file.wav [options]
options:
-D | --card <card number> The card to receive the audio
-d | --device <device number> The device to receive the audio
-p | --period-size <size> The size of the PCM's period
-n | --period-count <count> The number of PCM periods
-i | --file-type <file-type> The type of file to read (raw or wav)
-c | --channels <count> The amount of channels per frame
-r | --rate <rate> The amount of frames per second
-b | --bits <bit-count> The number of bits in one sample
-f | --float The frames are in floating-point PCM
-M | --mmap Use memory mapped IO to play audio
-F | --conf-name The parameters of configuration File, (Mandatory)
-I | --in-file Use offline input file mode, without playback via
sound card
-O | --out-file The output file name
-Z | --debug-mode Use debug mode, 0:disabled 1:summary 2:per-frame
3:summary+per-frame (default: 0)
For example:
./rockaa_play -I speech_2ch.wav -O out_effect.pcm -p 256 -Z 1 -F config_playeffect.bin
