tirtc-devtools-cli 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +3 -2
  2. package/dist/cli/src/index.js +4 -0
  3. package/dist/cli/src/role_driver.d.ts +4 -0
  4. package/dist/cli/src/role_driver.js +42 -0
  5. package/dist/cli/src/role_live_log.js +14 -2
  6. package/package.json +1 -1
  7. package/vendor/devtools/driver/linux-x64/devtools_driver_probe +0 -0
  8. package/vendor/devtools/driver/macos-arm64/devtools_driver_probe +0 -0
  9. package/vendor/runtime/linux-x64/include/tirtc/audio.h +50 -3
  10. package/vendor/runtime/linux-x64/include/tirtc/audio_codec.h +6 -0
  11. package/vendor/runtime/linux-x64/include/tirtc/audio_format.h +20 -0
  12. package/vendor/runtime/linux-x64/include/tirtc/audio_frame.h +3 -4
  13. package/vendor/runtime/linux-x64/include/tirtc/audio_io.h +2 -3
  14. package/vendor/runtime/linux-x64/include/tirtc/audio_processing.h +1 -0
  15. package/vendor/runtime/linux-x64/include/tirtc/av.h +7 -2
  16. package/vendor/runtime/linux-x64/include/tirtc/media_codec.h +1 -0
  17. package/vendor/runtime/linux-x64/include/tirtc/media_downlink.h +28 -0
  18. package/vendor/runtime/linux-x64/include/tirtc/media_uplink.h +2 -1
  19. package/vendor/runtime/linux-x64/include/tirtc/transport.h +1 -1
  20. package/vendor/runtime/linux-x64/include/tirtc/trp.h +1 -0
  21. package/vendor/runtime/linux-x64/lib/libTiRTC.a +0 -0
  22. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_audio.a +0 -0
  23. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_facade.a +0 -0
  24. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
  25. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_media.a +0 -0
  26. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_transport.a +0 -0
  27. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_video.a +0 -0
  28. package/vendor/runtime/linux-x64/lib/libmbedtls.a +0 -0
  29. package/vendor/runtime/linux-x64/lib/libusrsctp.a +0 -0
  30. package/vendor/runtime/linux-x64/lib/libwebrtc.a +0 -0
  31. package/vendor/runtime/linux-x64/manifest.txt +23 -19
  32. package/vendor/runtime/macos-arm64/include/tirtc/audio.h +50 -3
  33. package/vendor/runtime/macos-arm64/include/tirtc/audio_codec.h +6 -0
  34. package/vendor/runtime/macos-arm64/include/tirtc/audio_format.h +20 -0
  35. package/vendor/runtime/macos-arm64/include/tirtc/audio_frame.h +3 -4
  36. package/vendor/runtime/macos-arm64/include/tirtc/audio_io.h +2 -3
  37. package/vendor/runtime/macos-arm64/include/tirtc/audio_processing.h +1 -0
  38. package/vendor/runtime/macos-arm64/include/tirtc/av.h +7 -2
  39. package/vendor/runtime/macos-arm64/include/tirtc/media_codec.h +1 -0
  40. package/vendor/runtime/macos-arm64/include/tirtc/media_downlink.h +28 -0
  41. package/vendor/runtime/macos-arm64/include/tirtc/media_uplink.h +2 -1
  42. package/vendor/runtime/macos-arm64/include/tirtc/transport.h +1 -1
  43. package/vendor/runtime/macos-arm64/include/tirtc/trp.h +1 -0
  44. package/vendor/runtime/macos-arm64/lib/libTiRTC.a +0 -0
  45. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
  46. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
  47. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
  48. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
  49. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
  50. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
  51. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
  52. package/vendor/runtime/macos-arm64/manifest.txt +21 -20
  53. package/vendor/runtime/script/prepare_runtime_media_dataset.sh +198 -95
@@ -133,19 +133,19 @@ require_cmd "$FFPROBE_BIN"
133
133
  SOURCE_ABS="$(cd "$(dirname "$SOURCE")" && pwd)/$(basename "$SOURCE")"
134
134
  SOURCE_FILE_NAME="$(basename "$SOURCE_ABS")"
135
135
 
136
- readonly k_schema_version=2
137
- readonly k_tool_version="runtime_local_assets_prepare_v5"
136
+ readonly k_schema_version=3
137
+ readonly k_tool_version="runtime_local_assets_prepare_v6"
138
138
  readonly k_video_max_width=1280
139
139
  readonly k_video_max_height=720
140
140
  readonly k_video_fps=15
141
141
  readonly k_audio_sample_rate_hz=8000
142
142
  readonly k_audio_sample_rate_16k_hz=16000
143
- readonly k_audio_channels=1
144
143
  readonly k_audio_packet_duration_ms=40
144
+ readonly k_audio_bits_per_sample=16
145
+ readonly k_aac_packet_samples_per_channel=1024
145
146
  readonly k_mjpeg_packet_duration_ms=80
146
147
  readonly k_mjpeg_extract_interval_seconds=10
147
148
  readonly k_loop_policy="continuous_pts"
148
- readonly k_audio_codec="g711a"
149
149
  readonly k_output_audio_format="pcm_s16"
150
150
  readonly k_output_video_format="rgba8888"
151
151
 
@@ -253,10 +253,6 @@ VIDEO_H265_PATH="$ASSETS_DIR/video/video.h265"
253
253
  VIDEO_H265_PACKET_INDEX_PATH="$ASSETS_DIR/video/video_h265_packets.csv"
254
254
  VIDEO_MJPEG_PATH="$ASSETS_DIR/video/video.mjpeg"
255
255
  VIDEO_MJPEG_PACKET_INDEX_PATH="$ASSETS_DIR/video/video_mjpeg_packets.csv"
256
- AUDIO_PATH="$ASSETS_DIR/audio/audio.g711a"
257
- AUDIO_PACKET_INDEX_PATH="$ASSETS_DIR/audio/audio_packets.csv"
258
- AUDIO_16K_PATH="$ASSETS_DIR/audio/audio_16k.g711a"
259
- AUDIO_16K_PACKET_INDEX_PATH="$ASSETS_DIR/audio/audio_16k_packets.csv"
260
256
 
261
257
  video_encode_args=(
262
258
  -vf "fps=${k_video_fps},scale=${TARGET_VIDEO_WIDTH}:${TARGET_VIDEO_HEIGHT}:flags=lanczos"
@@ -335,26 +331,6 @@ if ! find "$mjpeg_frame_dir" -type f -name 'frame_*.jpg' | grep -q .; then
335
331
  "$mjpeg_frame_dir/frame_000001.jpg"
336
332
  fi
337
333
 
338
- progress "encoding 8k g711a audio track"
339
- "$FFMPEG_BIN" -hide_banner -loglevel error -y \
340
- -i "$SOURCE_ABS" \
341
- -vn \
342
- -ac ${k_audio_channels} \
343
- -ar ${k_audio_sample_rate_hz} \
344
- -c:a pcm_alaw \
345
- -f alaw \
346
- "$AUDIO_PATH"
347
-
348
- progress "encoding 16k g711a audio track"
349
- "$FFMPEG_BIN" -hide_banner -loglevel error -y \
350
- -i "$SOURCE_ABS" \
351
- -vn \
352
- -ac ${k_audio_channels} \
353
- -ar ${k_audio_sample_rate_16k_hz} \
354
- -c:a pcm_alaw \
355
- -f alaw \
356
- "$AUDIO_16K_PATH"
357
-
358
334
  progress "indexing h264 video packets"
359
335
  VIDEO_PACKET_INDEX_PATH="$VIDEO_H264_PACKET_INDEX_PATH" \
360
336
  VIDEO_PATH="$VIDEO_H264_PATH" \
@@ -607,16 +583,35 @@ for (let index = 0; index < packetCount; index += 1) {
607
583
  fs.writeFileSync(indexPath, `${lines.join('\n')}\n`, 'utf8');
608
584
  NODE
609
585
 
610
- progress "indexing 8k g711a audio packets"
611
- AUDIO_BYTES="$(wc -c < "$AUDIO_PATH" | tr -d '[:space:]')"
612
- AUDIO_PACKET_BYTES=$((k_audio_sample_rate_hz * k_audio_packet_duration_ms / 1000))
613
- [[ "$AUDIO_PACKET_BYTES" -gt 0 ]] || fail "invalid audio packet bytes"
614
- AUDIO_REMAINDER=$((AUDIO_BYTES % AUDIO_PACKET_BYTES))
615
- if [[ "$AUDIO_REMAINDER" -ne 0 ]]; then
616
- AUDIO_ALIGNED_BYTES=$((AUDIO_BYTES - AUDIO_REMAINDER))
617
- [[ "$AUDIO_ALIGNED_BYTES" -gt 0 ]] || fail "audio output is too short for one full packet"
618
- echo "[prepare_runtime_media_dataset] trim trailing audio bytes to packet boundary: removed=${AUDIO_REMAINDER}" >&2
619
- AUDIO_PATH="$AUDIO_PATH" AUDIO_ALIGNED_BYTES="$AUDIO_ALIGNED_BYTES" node <<'NODE'
586
+ encode_g711a_track() {
587
+ local sample_rate="$1"
588
+ local channels="$2"
589
+ local key="$3"
590
+ local output_path="$ASSETS_DIR/audio/${key}.g711a"
591
+ local index_path="$ASSETS_DIR/audio/${key}.csv"
592
+
593
+ progress "encoding ${key} audio track"
594
+ "$FFMPEG_BIN" -hide_banner -loglevel error -y \
595
+ -i "$SOURCE_ABS" \
596
+ -vn \
597
+ -ac "$channels" \
598
+ -ar "$sample_rate" \
599
+ -c:a pcm_alaw \
600
+ -f alaw \
601
+ "$output_path"
602
+
603
+ progress "indexing ${key} audio packets"
604
+ local audio_bytes
605
+ audio_bytes="$(wc -c < "$output_path" | tr -d '[:space:]')"
606
+ local samples_per_packet=$((sample_rate * k_audio_packet_duration_ms / 1000))
607
+ local packet_bytes=$((samples_per_packet * channels))
608
+ [[ "$packet_bytes" -gt 0 ]] || fail "invalid audio packet bytes"
609
+ local remainder=$((audio_bytes % packet_bytes))
610
+ if [[ "$remainder" -ne 0 ]]; then
611
+ local aligned_bytes=$((audio_bytes - remainder))
612
+ [[ "$aligned_bytes" -gt 0 ]] || fail "${key} audio output is too short for one full packet"
613
+ echo "[prepare_runtime_media_dataset] trim trailing ${key} bytes to packet boundary: removed=${remainder}" >&2
614
+ AUDIO_PATH="$output_path" AUDIO_ALIGNED_BYTES="$aligned_bytes" node <<'NODE'
620
615
  const fs = require('fs');
621
616
  const audioPath = process.env.AUDIO_PATH;
622
617
  const alignedBytes = Number(process.env.AUDIO_ALIGNED_BYTES || '0');
@@ -625,51 +620,93 @@ if (!audioPath || !Number.isFinite(alignedBytes) || alignedBytes <= 0) {
625
620
  }
626
621
  fs.truncateSync(audioPath, alignedBytes);
627
622
  NODE
628
- AUDIO_BYTES="$AUDIO_ALIGNED_BYTES"
629
- fi
630
- AUDIO_PACKET_COUNT=$((AUDIO_BYTES / AUDIO_PACKET_BYTES))
631
- [[ "$AUDIO_PACKET_COUNT" -gt 0 ]] || fail "generated audio packets are empty"
632
-
633
- {
634
- echo "pts_us,offset,size"
635
- for ((i = 0; i < AUDIO_PACKET_COUNT; i += 1)); do
636
- pts_us=$((i * k_audio_packet_duration_ms * 1000))
637
- offset=$((i * AUDIO_PACKET_BYTES))
638
- echo "${pts_us},${offset},${AUDIO_PACKET_BYTES}"
639
- done
640
- } > "$AUDIO_PACKET_INDEX_PATH"
641
-
642
- progress "indexing 16k g711a audio packets"
643
- AUDIO_16K_BYTES="$(wc -c < "$AUDIO_16K_PATH" | tr -d '[:space:]')"
644
- AUDIO_16K_PACKET_BYTES=$((k_audio_sample_rate_16k_hz * k_audio_packet_duration_ms / 1000))
645
- [[ "$AUDIO_16K_PACKET_BYTES" -gt 0 ]] || fail "invalid 16k audio packet bytes"
646
- AUDIO_16K_REMAINDER=$((AUDIO_16K_BYTES % AUDIO_16K_PACKET_BYTES))
647
- if [[ "$AUDIO_16K_REMAINDER" -ne 0 ]]; then
648
- AUDIO_16K_ALIGNED_BYTES=$((AUDIO_16K_BYTES - AUDIO_16K_REMAINDER))
649
- [[ "$AUDIO_16K_ALIGNED_BYTES" -gt 0 ]] || fail "16k audio output is too short for one full packet"
650
- echo "[prepare_runtime_media_dataset] trim trailing 16k audio bytes to packet boundary: removed=${AUDIO_16K_REMAINDER}" >&2
651
- AUDIO_PATH="$AUDIO_16K_PATH" AUDIO_ALIGNED_BYTES="$AUDIO_16K_ALIGNED_BYTES" node <<'NODE'
623
+ audio_bytes="$aligned_bytes"
624
+ fi
625
+ local packet_count=$((audio_bytes / packet_bytes))
626
+ [[ "$packet_count" -gt 0 ]] || fail "generated ${key} audio packets are empty"
627
+
628
+ {
629
+ echo "pts_us,offset,size,samples_per_channel"
630
+ for ((i = 0; i < packet_count; i += 1)); do
631
+ pts_us=$((i * k_audio_packet_duration_ms * 1000))
632
+ offset=$((i * packet_bytes))
633
+ echo "${pts_us},${offset},${packet_bytes},${samples_per_packet}"
634
+ done
635
+ } > "$index_path"
636
+ }
637
+
638
+ encode_aac_track() {
639
+ local sample_rate="$1"
640
+ local channels="$2"
641
+ local key="$3"
642
+ local adts_path="$ASSETS_DIR/audio/${key}.adts"
643
+ local output_path="$ASSETS_DIR/audio/${key}.aac"
644
+ local index_path="$ASSETS_DIR/audio/${key}.csv"
645
+
646
+ progress "encoding ${key} audio track"
647
+ "$FFMPEG_BIN" -hide_banner -loglevel error -y \
648
+ -i "$SOURCE_ABS" \
649
+ -vn \
650
+ -ac "$channels" \
651
+ -ar "$sample_rate" \
652
+ -c:a aac \
653
+ -profile:a aac_low \
654
+ -f adts \
655
+ "$adts_path"
656
+
657
+ progress "indexing ${key} audio packets"
658
+ ADTS_PATH="$adts_path" OUTPUT_PATH="$output_path" INDEX_PATH="$index_path" SAMPLE_RATE="$sample_rate" AAC_PACKET_SAMPLES_PER_CHANNEL="$k_aac_packet_samples_per_channel" node <<'NODE'
652
659
  const fs = require('fs');
653
- const audioPath = process.env.AUDIO_PATH;
654
- const alignedBytes = Number(process.env.AUDIO_ALIGNED_BYTES || '0');
655
- if (!audioPath || !Number.isFinite(alignedBytes) || alignedBytes <= 0) {
656
- throw new Error('audio trim env is incomplete');
660
+ const adtsPath = process.env.ADTS_PATH;
661
+ const outputPath = process.env.OUTPUT_PATH;
662
+ const indexPath = process.env.INDEX_PATH;
663
+ const sampleRate = Number(process.env.SAMPLE_RATE || '0');
664
+ if (!adtsPath || !outputPath || !indexPath || !Number.isFinite(sampleRate) || sampleRate <= 0) {
665
+ throw new Error('aac packet index env is incomplete');
666
+ }
667
+ const data = fs.readFileSync(adtsPath);
668
+ const chunks = [];
669
+ const rows = ['pts_us,offset,size,samples_per_channel'];
670
+ let cursor = 0;
671
+ let outputOffset = 0;
672
+ let packetIndex = 0;
673
+ const samplesPerChannel = Number(process.env.AAC_PACKET_SAMPLES_PER_CHANNEL || '1024');
674
+ if (!Number.isFinite(samplesPerChannel) || samplesPerChannel <= 0) {
675
+ throw new Error('aac packet samples env is invalid');
676
+ }
677
+ while (cursor + 7 <= data.length) {
678
+ if (data[cursor] !== 0xff || (data[cursor + 1] & 0xf0) !== 0xf0) {
679
+ throw new Error(`aac adts sync missing at offset ${cursor}`);
680
+ }
681
+ const protectionAbsent = data[cursor + 1] & 0x01;
682
+ const headerBytes = protectionAbsent ? 7 : 9;
683
+ const frameLength = ((data[cursor + 3] & 0x03) << 11) | (data[cursor + 4] << 3) | ((data[cursor + 5] & 0xe0) >> 5);
684
+ if (frameLength <= headerBytes || cursor + frameLength > data.length) {
685
+ throw new Error(`aac adts invalid frame length at offset ${cursor}`);
686
+ }
687
+ const payload = data.subarray(cursor + headerBytes, cursor + frameLength);
688
+ const ptsUs = Math.round(packetIndex * samplesPerChannel * 1_000_000 / sampleRate);
689
+ rows.push(`${ptsUs},${outputOffset},${payload.length},${samplesPerChannel}`);
690
+ chunks.push(payload);
691
+ outputOffset += payload.length;
692
+ packetIndex += 1;
693
+ cursor += frameLength;
657
694
  }
658
- fs.truncateSync(audioPath, alignedBytes);
695
+ if (packetIndex === 0 || outputOffset === 0) {
696
+ throw new Error('aac packet index is empty');
697
+ }
698
+ fs.writeFileSync(outputPath, Buffer.concat(chunks));
699
+ fs.writeFileSync(indexPath, `${rows.join('\n')}\n`, 'utf8');
700
+ fs.rmSync(adtsPath, {force: true});
659
701
  NODE
660
- AUDIO_16K_BYTES="$AUDIO_16K_ALIGNED_BYTES"
661
- fi
662
- AUDIO_16K_PACKET_COUNT=$((AUDIO_16K_BYTES / AUDIO_16K_PACKET_BYTES))
663
- [[ "$AUDIO_16K_PACKET_COUNT" -gt 0 ]] || fail "generated 16k audio packets are empty"
702
+ }
664
703
 
665
- {
666
- echo "pts_us,offset,size"
667
- for ((i = 0; i < AUDIO_16K_PACKET_COUNT; i += 1)); do
668
- pts_us=$((i * k_audio_packet_duration_ms * 1000))
669
- offset=$((i * AUDIO_16K_PACKET_BYTES))
670
- echo "${pts_us},${offset},${AUDIO_16K_PACKET_BYTES}"
704
+ for sample_rate in "$k_audio_sample_rate_hz" "$k_audio_sample_rate_16k_hz"; do
705
+ for channels in 1 2; do
706
+ encode_g711a_track "$sample_rate" "$channels" "g711a_${sample_rate}_${channels}ch_s16"
707
+ encode_aac_track "$sample_rate" "$channels" "aac_${sample_rate}_${channels}ch_s16"
671
708
  done
672
- } > "$AUDIO_16K_PACKET_INDEX_PATH"
709
+ done
673
710
 
674
711
  progress "writing prepared media manifest"
675
712
  cat > "$MANIFEST_PATH" <<JSON
@@ -690,12 +727,14 @@ cat > "$MANIFEST_PATH" <<JSON
690
727
  "bitrate_kbps": ${TARGET_VIDEO_BITRATE_KBPS}
691
728
  },
692
729
  "audio": {
693
- "path": "audio/audio.g711a",
694
- "packet_index_path": "audio/audio_packets.csv",
695
- "codec": "${k_audio_codec}",
730
+ "path": "audio/g711a_8000_1ch_s16.g711a",
731
+ "packet_index_path": "audio/g711a_8000_1ch_s16.csv",
732
+ "codec": "g711a",
696
733
  "sample_rate_hz": ${k_audio_sample_rate_hz},
697
- "channels": ${k_audio_channels},
698
- "packet_duration_ms": ${k_audio_packet_duration_ms}
734
+ "channels": 1,
735
+ "bits_per_sample": ${k_audio_bits_per_sample},
736
+ "packet_duration_ms": ${k_audio_packet_duration_ms},
737
+ "packet_samples_per_channel": $((k_audio_sample_rate_hz * k_audio_packet_duration_ms / 1000))
699
738
  },
700
739
  "output": {
701
740
  "audio_format": "${k_output_audio_format}",
@@ -731,21 +770,85 @@ cat > "$MANIFEST_PATH" <<JSON
731
770
  }
732
771
  },
733
772
  "audio_tracks": {
734
- "g711a_8k": {
735
- "path": "audio/audio.g711a",
736
- "packet_index_path": "audio/audio_packets.csv",
737
- "codec": "${k_audio_codec}",
773
+ "g711a_8000_1ch_s16": {
774
+ "path": "audio/g711a_8000_1ch_s16.g711a",
775
+ "packet_index_path": "audio/g711a_8000_1ch_s16.csv",
776
+ "codec": "g711a",
777
+ "sample_rate_hz": ${k_audio_sample_rate_hz},
778
+ "channels": 1,
779
+ "bits_per_sample": ${k_audio_bits_per_sample},
780
+ "packet_duration_ms": ${k_audio_packet_duration_ms},
781
+ "packet_samples_per_channel": $((k_audio_sample_rate_hz * k_audio_packet_duration_ms / 1000))
782
+ },
783
+ "g711a_8000_2ch_s16": {
784
+ "path": "audio/g711a_8000_2ch_s16.g711a",
785
+ "packet_index_path": "audio/g711a_8000_2ch_s16.csv",
786
+ "codec": "g711a",
738
787
  "sample_rate_hz": ${k_audio_sample_rate_hz},
739
- "channels": ${k_audio_channels},
740
- "packet_duration_ms": ${k_audio_packet_duration_ms}
788
+ "channels": 2,
789
+ "bits_per_sample": ${k_audio_bits_per_sample},
790
+ "packet_duration_ms": ${k_audio_packet_duration_ms},
791
+ "packet_samples_per_channel": $((k_audio_sample_rate_hz * k_audio_packet_duration_ms / 1000))
792
+ },
793
+ "g711a_16000_1ch_s16": {
794
+ "path": "audio/g711a_16000_1ch_s16.g711a",
795
+ "packet_index_path": "audio/g711a_16000_1ch_s16.csv",
796
+ "codec": "g711a",
797
+ "sample_rate_hz": ${k_audio_sample_rate_16k_hz},
798
+ "channels": 1,
799
+ "bits_per_sample": ${k_audio_bits_per_sample},
800
+ "packet_duration_ms": ${k_audio_packet_duration_ms},
801
+ "packet_samples_per_channel": $((k_audio_sample_rate_16k_hz * k_audio_packet_duration_ms / 1000))
802
+ },
803
+ "g711a_16000_2ch_s16": {
804
+ "path": "audio/g711a_16000_2ch_s16.g711a",
805
+ "packet_index_path": "audio/g711a_16000_2ch_s16.csv",
806
+ "codec": "g711a",
807
+ "sample_rate_hz": ${k_audio_sample_rate_16k_hz},
808
+ "channels": 2,
809
+ "bits_per_sample": ${k_audio_bits_per_sample},
810
+ "packet_duration_ms": ${k_audio_packet_duration_ms},
811
+ "packet_samples_per_channel": $((k_audio_sample_rate_16k_hz * k_audio_packet_duration_ms / 1000))
812
+ },
813
+ "aac_8000_1ch_s16": {
814
+ "path": "audio/aac_8000_1ch_s16.aac",
815
+ "packet_index_path": "audio/aac_8000_1ch_s16.csv",
816
+ "codec": "aac",
817
+ "sample_rate_hz": ${k_audio_sample_rate_hz},
818
+ "channels": 1,
819
+ "bits_per_sample": ${k_audio_bits_per_sample},
820
+ "packet_duration_ms": $((k_aac_packet_samples_per_channel * 1000 / k_audio_sample_rate_hz)),
821
+ "packet_samples_per_channel": ${k_aac_packet_samples_per_channel}
822
+ },
823
+ "aac_8000_2ch_s16": {
824
+ "path": "audio/aac_8000_2ch_s16.aac",
825
+ "packet_index_path": "audio/aac_8000_2ch_s16.csv",
826
+ "codec": "aac",
827
+ "sample_rate_hz": ${k_audio_sample_rate_hz},
828
+ "channels": 2,
829
+ "bits_per_sample": ${k_audio_bits_per_sample},
830
+ "packet_duration_ms": $((k_aac_packet_samples_per_channel * 1000 / k_audio_sample_rate_hz)),
831
+ "packet_samples_per_channel": ${k_aac_packet_samples_per_channel}
832
+ },
833
+ "aac_16000_1ch_s16": {
834
+ "path": "audio/aac_16000_1ch_s16.aac",
835
+ "packet_index_path": "audio/aac_16000_1ch_s16.csv",
836
+ "codec": "aac",
837
+ "sample_rate_hz": ${k_audio_sample_rate_16k_hz},
838
+ "channels": 1,
839
+ "bits_per_sample": ${k_audio_bits_per_sample},
840
+ "packet_duration_ms": $((k_aac_packet_samples_per_channel * 1000 / k_audio_sample_rate_16k_hz)),
841
+ "packet_samples_per_channel": ${k_aac_packet_samples_per_channel}
741
842
  },
742
- "g711a_16k": {
743
- "path": "audio/audio_16k.g711a",
744
- "packet_index_path": "audio/audio_16k_packets.csv",
745
- "codec": "${k_audio_codec}",
843
+ "aac_16000_2ch_s16": {
844
+ "path": "audio/aac_16000_2ch_s16.aac",
845
+ "packet_index_path": "audio/aac_16000_2ch_s16.csv",
846
+ "codec": "aac",
746
847
  "sample_rate_hz": ${k_audio_sample_rate_16k_hz},
747
- "channels": ${k_audio_channels},
748
- "packet_duration_ms": ${k_audio_packet_duration_ms}
848
+ "channels": 2,
849
+ "bits_per_sample": ${k_audio_bits_per_sample},
850
+ "packet_duration_ms": $((k_aac_packet_samples_per_channel * 1000 / k_audio_sample_rate_16k_hz)),
851
+ "packet_samples_per_channel": ${k_aac_packet_samples_per_channel}
749
852
  }
750
853
  },
751
854
  "loop_policy": "${k_loop_policy}"