tirtc-devtools-cli 0.0.14 → 0.1.0

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 (56) hide show
  1. package/README.md +1 -1
  2. package/USAGE.md +1 -3
  3. package/dist/cli/src/index.js +17 -1
  4. package/package.json +3 -2
  5. package/vendor/devtools/driver/linux-x64/devtools_driver_probe +0 -0
  6. package/vendor/devtools/driver/macos-arm64/devtools_driver_probe +0 -0
  7. package/vendor/runtime/linux-x64/include/tirtc/audio.h +216 -0
  8. package/vendor/runtime/linux-x64/include/tirtc/audio_codec.h +23 -0
  9. package/vendor/runtime/linux-x64/include/tirtc/audio_frame.h +36 -0
  10. package/vendor/runtime/linux-x64/include/tirtc/audio_io.h +65 -0
  11. package/vendor/runtime/linux-x64/include/tirtc/audio_io_android.h +19 -0
  12. package/vendor/runtime/linux-x64/include/tirtc/audio_io_apple.h +19 -0
  13. package/vendor/runtime/linux-x64/include/tirtc/audio_io_harmony.h +19 -0
  14. package/vendor/runtime/linux-x64/include/tirtc/audio_io_windows.h +19 -0
  15. package/vendor/runtime/linux-x64/include/tirtc/audio_processing.h +56 -0
  16. package/vendor/runtime/linux-x64/include/tirtc/audio_sample_rate.h +18 -0
  17. package/vendor/runtime/linux-x64/include/tirtc/av.h +208 -0
  18. package/vendor/runtime/linux-x64/include/tirtc/error.h +63 -0
  19. package/vendor/runtime/linux-x64/include/tirtc/foundation/build_info.h +27 -0
  20. package/vendor/runtime/linux-x64/include/tirtc/http.h +57 -0
  21. package/vendor/runtime/linux-x64/include/tirtc/logging.h +55 -0
  22. package/vendor/runtime/linux-x64/include/tirtc/media_codec.h +21 -0
  23. package/vendor/runtime/linux-x64/include/tirtc/media_downlink.h +154 -0
  24. package/vendor/runtime/linux-x64/include/tirtc/media_uplink.h +120 -0
  25. package/vendor/runtime/linux-x64/include/tirtc/transport.h +445 -0
  26. package/vendor/runtime/linux-x64/include/tirtc/trp.h +187 -0
  27. package/vendor/runtime/linux-x64/include/tirtc/video_codec.h +99 -0
  28. package/vendor/runtime/linux-x64/include/tirtc/video_frame.h +55 -0
  29. package/vendor/runtime/linux-x64/include/tirtc/video_io.h +53 -0
  30. package/vendor/runtime/linux-x64/include/tirtc/video_io_android.h +34 -0
  31. package/vendor/runtime/linux-x64/include/tirtc/video_io_apple.h +47 -0
  32. package/vendor/runtime/linux-x64/include/tirtc/video_io_harmony.h +32 -0
  33. package/vendor/runtime/linux-x64/include/tirtc/video_io_windows.h +26 -0
  34. package/vendor/runtime/linux-x64/include/tirtc/video_processing.h +34 -0
  35. package/vendor/runtime/linux-x64/lib/libTiRTC.a +0 -0
  36. package/vendor/runtime/linux-x64/lib/libcrypto.a +0 -0
  37. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_audio.a +0 -0
  38. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_facade.a +0 -0
  39. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_foundation_http.a +0 -0
  40. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
  41. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_media.a +0 -0
  42. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_transport.a +0 -0
  43. package/vendor/runtime/linux-x64/lib/libmatrix_runtime_video.a +0 -0
  44. package/vendor/runtime/linux-x64/lib/libssl.a +0 -0
  45. package/vendor/runtime/linux-x64/lib/libwebrtc_apm.a +0 -0
  46. package/vendor/runtime/linux-x64/lib/libxlog.a +0 -0
  47. package/vendor/runtime/linux-x64/manifest.txt +45 -0
  48. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
  49. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
  50. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
  51. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
  52. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
  53. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
  54. package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
  55. package/vendor/runtime/macos-arm64/manifest.txt +8 -8
  56. package/vendor/devtools/driver/macos-arm64/runtime_validation_client_bin +0 -0
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  - 不提供长驻 Host、HTTP API、共享 session 或桌面 UI。
17
17
  - 不替代业务鉴权系统;token 签发只服务 DevTools 联调与验收。
18
18
  - 不把 `bootstrap.json` 定义成移动端接入协议;它只是本机 CLI receive、sample smoke 和 validation automation 的交接产物。
19
- - 不宣称 Linux native send/receive 调试已支持;当前外部调试发布面先按 `macos-arm64` 收口。
19
+ - 不提供长驻 Linux 服务端;Linux 调试发布面是 `linux-x64` native CLI/driver,运行在 Linux host 或 `linux/amd64` container。
20
20
 
21
21
  ## 依赖方向
22
22
 
package/USAGE.md CHANGED
@@ -16,9 +16,7 @@ node products/cli/bin/tirtc-devtools-cli.js --help
16
16
  ## Platform Support
17
17
 
18
18
  - `macos-arm64`: supported for token, assets prepare, send, receive, package smoke, and native send+receive qualification.
19
- - `linux-x64`: runtime package surface and cross-build are covered, but native send/receive qualification is not a supported external debugging path yet.
20
-
21
- Do not treat Linux send/receive as ready until the Linux headless receive driver or a containerized online runner is delivered.
19
+ - `linux-x64`: supported for token, assets prepare, send, receive, package smoke, and native driver packaging. Linux native send/receive runs through the packaged headless driver on Linux hosts or `linux/amd64` containers.
22
20
 
23
21
  ## Token
24
22
 
@@ -1,10 +1,26 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const commander_1 = require("commander");
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const embedded_paths_1 = require("./embedded_paths");
4
10
  const media_assets_1 = require("./media_assets");
5
11
  const token_command_1 = require("./token_command");
6
12
  const role_driver_1 = require("./role_driver");
7
- const cliVersion = '0.0.14';
13
+ function resolveCliVersion() {
14
+ try {
15
+ const packageRoot = (0, embedded_paths_1.resolveCliPackageRoot)(__dirname);
16
+ const packageJson = JSON.parse(fs_1.default.readFileSync(path_1.default.join(packageRoot, 'package.json'), 'utf8'));
17
+ return typeof packageJson.version === 'string' ? packageJson.version : 'unknown';
18
+ }
19
+ catch {
20
+ return 'unknown';
21
+ }
22
+ }
23
+ const cliVersion = resolveCliVersion();
8
24
  if (process.argv.includes('--version') || process.argv.includes('-V')) {
9
25
  console.log('CLI Version: ' + cliVersion);
10
26
  console.log('DevTools Driver Contract: 1');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tirtc-devtools-cli",
3
- "version": "0.0.14",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
5
  "main": "dist/cli/src/index.js",
6
6
  "types": "dist/cli/src/index.d.ts",
@@ -30,7 +30,8 @@
30
30
  "lint": "eslint . --ext .ts --max-warnings=0",
31
31
  "lint:fix": "eslint . --ext .ts --fix",
32
32
  "package": "./script/package.sh",
33
- "release:npm": "./script/release-npm.sh"
33
+ "release:npm": "./script/release-npm.sh",
34
+ "release:devtools-cli": "./script/release_devtools_cli.sh"
34
35
  },
35
36
  "pkg": {
36
37
  "assets": [
@@ -0,0 +1,216 @@
1
+ #ifndef TIRTC_FACADE_AUDIO_H_
2
+ #define TIRTC_FACADE_AUDIO_H_
3
+
4
+ #include <stdint.h>
5
+
6
+ #include "tirtc/audio_frame.h"
7
+ #include "tirtc/audio_io.h"
8
+ #include "tirtc/audio_processing.h"
9
+ #include "tirtc/media_codec.h"
10
+ #include "tirtc/trp.h"
11
+
12
+ #ifdef __cplusplus
13
+ extern "C" {
14
+ #endif
15
+
16
+ typedef struct TirtcAudioInput TirtcAudioInput;
17
+
18
+ typedef struct TirtcAudioEncodedInput TirtcAudioEncodedInput;
19
+
20
+ typedef struct TirtcAudioOutput TirtcAudioOutput;
21
+
22
+ typedef enum TirtcInputState {
23
+
24
+ TIRTC_INPUT_STATE_IDLE = 0,
25
+
26
+ TIRTC_INPUT_STATE_RUNNING = 1,
27
+
28
+ TIRTC_INPUT_STATE_STOPPED = 2,
29
+
30
+ TIRTC_INPUT_STATE_FAILED = 3,
31
+ } TirtcInputState;
32
+
33
+ typedef enum TirtcAudioOutputState {
34
+
35
+ TIRTC_AUDIO_OUTPUT_STATE_IDLE = 0,
36
+
37
+ TIRTC_AUDIO_OUTPUT_STATE_BUFFERING = 1,
38
+
39
+ TIRTC_AUDIO_OUTPUT_STATE_PLAYING = 2,
40
+
41
+ TIRTC_AUDIO_OUTPUT_STATE_FAILED = 3,
42
+ } TirtcAudioOutputState;
43
+
44
+ typedef struct TirtcAudioInputOptions {
45
+ TirtcAudioSampleRate sample_rate;
46
+
47
+ TirtcAudioAecMode aec_mode;
48
+
49
+ TirtcAudioAgcLevel agc_level;
50
+
51
+ TirtcAudioAnsLevel ans_level;
52
+ } TirtcAudioInputOptions;
53
+
54
+ /**
55
+ * Options for a facade audio encoded input.
56
+ *
57
+ * The encoded input does not own or create an audio source. Callers submit already-encoded audio
58
+ * frames with `tirtc_audio_encoded_input_submit_frame()`. Non-NONE fields constrain submitted
59
+ * frames and reject mismatched packets with `TIRTC_ERROR_INVALID_ARGUMENT`.
60
+ */
61
+ typedef struct TirtcAudioEncodedInputOptions {
62
+ TirtcMediaCodec codec;
63
+
64
+ TirtcAudioSampleRate sample_rate;
65
+ } TirtcAudioEncodedInputOptions;
66
+
67
+ typedef struct TirtcAudioOutputOptions {
68
+ uint32_t volume_percent;
69
+
70
+ TirtcAudioAgcLevel agc_level;
71
+
72
+ TirtcAudioAnsLevel ans_level;
73
+ } TirtcAudioOutputOptions;
74
+
75
+ typedef struct TirtcOutputStutterMetrics {
76
+ int session_started;
77
+ uint64_t session_duration_ms;
78
+ uint64_t session_stutter_total_ms;
79
+ uint32_t session_stutter_count;
80
+ uint64_t session_stutter_peak_ms;
81
+ double session_stutter_ratio;
82
+ uint32_t recent_window_duration_ms;
83
+ uint64_t recent_window_stutter_total_ms;
84
+ uint32_t recent_window_stutter_count;
85
+ uint64_t recent_window_stutter_peak_ms;
86
+ double recent_window_stutter_ratio;
87
+ } TirtcOutputStutterMetrics;
88
+
89
+ typedef struct TirtcPendingDurationMetrics {
90
+ uint64_t undecoded_duration_ms;
91
+ uint64_t decoded_duration_ms;
92
+ } TirtcPendingDurationMetrics;
93
+
94
+ typedef struct TirtcAudioOutputMetricsSnapshot {
95
+ TirtcOutputStutterMetrics stutter;
96
+ TirtcPendingDurationMetrics pending;
97
+ } TirtcAudioOutputMetricsSnapshot;
98
+
99
+ /**
100
+ * Audio input observer.
101
+ *
102
+ * `owned_message` is allocated by facade for this callback dispatch. Consumers must release it
103
+ * with `tirtc_owned_string_release()` after copying or converting the string they need.
104
+ */
105
+ typedef struct TirtcAudioInputObserver {
106
+ void (*on_state_changed)(TirtcAudioInput* input, TirtcInputState state, void* user_data);
107
+
108
+ void (*on_error)(TirtcAudioInput* input, TirtcError error, TirtcOwnedString* owned_message,
109
+ void* user_data);
110
+ } TirtcAudioInputObserver;
111
+
112
+ /**
113
+ * Audio encoded input observer.
114
+ *
115
+ * State callbacks report only facade input lifecycle changes. They do not mean a remote consumer
116
+ * has subscribed to, decoded, or rendered the stream. `owned_message` is allocated by facade for
117
+ * this callback dispatch; consumers must release it with `tirtc_owned_string_release()`.
118
+ */
119
+ typedef struct TirtcAudioEncodedInputObserver {
120
+ void (*on_state_changed)(TirtcAudioEncodedInput* input, TirtcInputState state, void* user_data);
121
+
122
+ void (*on_error)(TirtcAudioEncodedInput* input, TirtcError error, TirtcOwnedString* owned_message,
123
+ void* user_data);
124
+ } TirtcAudioEncodedInputObserver;
125
+
126
+ /**
127
+ * Audio output observer.
128
+ *
129
+ * `owned_message` is allocated by facade for this callback dispatch. Consumers must release it
130
+ * with `tirtc_owned_string_release()` after copying or converting the string they need.
131
+ */
132
+ typedef struct TirtcAudioOutputObserver {
133
+ void (*on_state_changed)(TirtcAudioOutput* output, TirtcAudioOutputState state, void* user_data);
134
+
135
+ void (*on_error)(TirtcAudioOutput* output, TirtcError error, TirtcOwnedString* owned_message,
136
+ void* user_data);
137
+ } TirtcAudioOutputObserver;
138
+
139
+ TirtcError tirtc_conn_subscribe_audio(TirtcConn* connection, uint8_t stream_id);
140
+
141
+ TirtcError tirtc_conn_unsubscribe_audio(TirtcConn* connection, uint8_t stream_id);
142
+
143
+ TirtcError tirtc_audio_input_create(TirtcAudioInput** out_input);
144
+
145
+ TirtcError tirtc_audio_input_set_ain(TirtcAudioInput* input, TirtcAudioAin* ain);
146
+
147
+ TirtcError tirtc_audio_input_set_options(TirtcAudioInput* input,
148
+ const TirtcAudioInputOptions* options);
149
+
150
+ TirtcError tirtc_audio_input_set_observer(TirtcAudioInput* input,
151
+ const TirtcAudioInputObserver* observer, void* user_data);
152
+
153
+ TirtcError tirtc_audio_input_start(TirtcAudioInput* input);
154
+
155
+ TirtcError tirtc_audio_input_stop(TirtcAudioInput* input);
156
+
157
+ TirtcError tirtc_audio_input_attach(TirtcAudioInput* input, TirtcConn* connection,
158
+ uint8_t stream_id);
159
+
160
+ TirtcError tirtc_audio_input_detach(TirtcAudioInput* input, TirtcConn* connection);
161
+
162
+ void tirtc_audio_input_destroy(TirtcAudioInput* input);
163
+
164
+ TirtcError tirtc_audio_encoded_input_create(TirtcAudioEncodedInput** out_input);
165
+
166
+ TirtcError tirtc_audio_encoded_input_set_options(TirtcAudioEncodedInput* input,
167
+ const TirtcAudioEncodedInputOptions* options);
168
+
169
+ TirtcError tirtc_audio_encoded_input_set_observer(TirtcAudioEncodedInput* input,
170
+ const TirtcAudioEncodedInputObserver* observer,
171
+ void* user_data);
172
+
173
+ TirtcError tirtc_audio_encoded_input_start(TirtcAudioEncodedInput* input);
174
+
175
+ TirtcError tirtc_audio_encoded_input_stop(TirtcAudioEncodedInput* input);
176
+
177
+ TirtcError tirtc_audio_encoded_input_attach(TirtcAudioEncodedInput* input, TirtcConn* connection,
178
+ uint8_t stream_id);
179
+
180
+ TirtcError tirtc_audio_encoded_input_detach(TirtcAudioEncodedInput* input, TirtcConn* connection);
181
+
182
+ TirtcError tirtc_audio_encoded_input_submit_frame(TirtcAudioEncodedInput* input,
183
+ const TirtcAudioEncodedFrame* frame);
184
+
185
+ void tirtc_audio_encoded_input_destroy(TirtcAudioEncodedInput* input);
186
+
187
+ TirtcError tirtc_audio_output_create(TirtcAudioOutput** out_output);
188
+
189
+ TirtcError tirtc_audio_output_set_aout(TirtcAudioOutput* output, TirtcAudioAout* aout);
190
+
191
+ TirtcError tirtc_audio_output_set_options(TirtcAudioOutput* output,
192
+ const TirtcAudioOutputOptions* options);
193
+
194
+ TirtcError tirtc_audio_output_set_observer(TirtcAudioOutput* output,
195
+ const TirtcAudioOutputObserver* observer,
196
+ void* user_data);
197
+
198
+ TirtcError tirtc_audio_output_attach(TirtcAudioOutput* output, TirtcConn* connection,
199
+ uint8_t stream_id);
200
+
201
+ TirtcError tirtc_audio_output_detach(TirtcAudioOutput* output);
202
+
203
+ void tirtc_audio_output_destroy(TirtcAudioOutput* output);
204
+
205
+ TirtcError tirtc_audio_output_start_raw_dump(TirtcAudioOutput* output);
206
+
207
+ TirtcError tirtc_audio_output_stop_raw_dump(TirtcAudioOutput* output);
208
+
209
+ TirtcError tirtc_metrics_audio_output_get_snapshot(TirtcAudioOutput* output,
210
+ TirtcAudioOutputMetricsSnapshot* out_snapshot);
211
+
212
+ #ifdef __cplusplus
213
+ }
214
+ #endif
215
+
216
+ #endif
@@ -0,0 +1,23 @@
1
+ #ifndef TIRTC_AUDIO_CODEC_H_
2
+ #define TIRTC_AUDIO_CODEC_H_
3
+
4
+ #include <stddef.h>
5
+
6
+ #include "tirtc/audio_frame.h"
7
+ #include "tirtc/error.h"
8
+
9
+ #ifdef __cplusplus
10
+ extern "C" {
11
+ #endif
12
+
13
+ TirtcError tirtc_audio_g711a_encode(const TirtcAudioPcmFrame* pcm_frame, void* out_buffer,
14
+ size_t out_buffer_capacity, TirtcAudioEncodedFrame* out_frame);
15
+
16
+ TirtcError tirtc_audio_g711a_decode(const TirtcAudioEncodedFrame* in_frame, void* out_buffer,
17
+ size_t out_buffer_capacity, TirtcAudioPcmFrame* out_frame);
18
+
19
+ #ifdef __cplusplus
20
+ }
21
+ #endif
22
+
23
+ #endif // TIRTC_AUDIO_CODEC_H_
@@ -0,0 +1,36 @@
1
+ #ifndef TIRTC_AUDIO_FRAME_H_
2
+ #define TIRTC_AUDIO_FRAME_H_
3
+
4
+ #include <stddef.h>
5
+ #include <stdint.h>
6
+
7
+ #include "tirtc/audio_sample_rate.h"
8
+ #include "tirtc/media_codec.h"
9
+
10
+ #ifdef __cplusplus
11
+ extern "C" {
12
+ #endif
13
+
14
+ typedef struct TirtcAudioPcmFrame {
15
+ TirtcAudioSampleRate sample_rate;
16
+ uint32_t samples_per_channel;
17
+ int64_t pts_us;
18
+ /* Mutable PCM payload for capture, processing, and render-fill paths. */
19
+ void* data;
20
+ size_t data_bytes;
21
+ } TirtcAudioPcmFrame;
22
+
23
+ typedef struct TirtcAudioEncodedFrame {
24
+ TirtcMediaCodec codec;
25
+ TirtcAudioSampleRate sample_rate;
26
+ uint32_t samples_per_channel;
27
+ int64_t pts_us;
28
+ const void* data;
29
+ size_t data_bytes;
30
+ } TirtcAudioEncodedFrame;
31
+
32
+ #ifdef __cplusplus
33
+ }
34
+ #endif
35
+
36
+ #endif // TIRTC_AUDIO_FRAME_H_
@@ -0,0 +1,65 @@
1
+ #ifndef TIRTC_AUDIO_IO_H_
2
+ #define TIRTC_AUDIO_IO_H_
3
+
4
+ #include <stdint.h>
5
+
6
+ #include "tirtc/audio_frame.h"
7
+ #include "tirtc/error.h"
8
+
9
+ #ifdef __cplusplus
10
+ extern "C" {
11
+ #endif
12
+
13
+ typedef struct TirtcAudioAin TirtcAudioAin;
14
+ typedef struct TirtcAudioAout TirtcAudioAout;
15
+
16
+ typedef struct TirtcAudioIoConfig {
17
+ TirtcAudioSampleRate sample_rate;
18
+ /* AIN uses fixed 10 ms mono blocks; AOUT may use larger callback-sized multiples. */
19
+ uint32_t samples_per_buffer;
20
+ } TirtcAudioIoConfig;
21
+
22
+ typedef struct TirtcAudioHeadlessAoutOptions {
23
+ const char* first_output_json_path;
24
+ const char* pcm_path;
25
+ uint32_t max_capture_bytes;
26
+ } TirtcAudioHeadlessAoutOptions;
27
+
28
+ typedef void (*TirtcAudioAinOnFrameFn)(TirtcAudioAin* ain, const TirtcAudioPcmFrame* frame,
29
+ void* user_data);
30
+
31
+ /*
32
+ * AOUT pre-fills sample_rate, samples_per_channel, data, and data_bytes before
33
+ * calling render. The callback contract expects a non-negative rendered PCM
34
+ * byte count. Backends defensively clamp negative returns to zero and zero-fill
35
+ * any remaining buffer space.
36
+ *
37
+ * The render callback and user_data supplied at open-time must stay valid until
38
+ * close completes. Backends may invoke render without holding backend locks.
39
+ */
40
+ typedef int (*TirtcAudioAoutRenderFn)(TirtcAudioAout* aout, TirtcAudioPcmFrame* frame,
41
+ void* user_data);
42
+
43
+ TirtcError tirtc_audio_ain_open(TirtcAudioAin* ain, const TirtcAudioIoConfig* config,
44
+ TirtcAudioAinOnFrameFn on_frame, void* user_data);
45
+
46
+ TirtcError tirtc_audio_ain_close(TirtcAudioAin* ain);
47
+ void tirtc_audio_ain_destroy(TirtcAudioAin* ain);
48
+
49
+ TirtcError tirtc_audio_aout_open(TirtcAudioAout* aout, const TirtcAudioIoConfig* config,
50
+ TirtcAudioAoutRenderFn render, void* user_data);
51
+
52
+ TirtcError tirtc_audio_aout_create_headless_capture(const TirtcAudioHeadlessAoutOptions* options,
53
+ TirtcAudioAout** out_aout);
54
+
55
+ TirtcError tirtc_audio_aout_set_volume(TirtcAudioAout* aout, uint32_t volume_percent);
56
+ TirtcError tirtc_audio_aout_pause(TirtcAudioAout* aout, int pause_on);
57
+ TirtcError tirtc_audio_aout_flush(TirtcAudioAout* aout);
58
+ TirtcError tirtc_audio_aout_close(TirtcAudioAout* aout);
59
+ void tirtc_audio_aout_destroy(TirtcAudioAout* aout);
60
+
61
+ #ifdef __cplusplus
62
+ }
63
+ #endif
64
+
65
+ #endif // TIRTC_AUDIO_IO_H_
@@ -0,0 +1,19 @@
1
+ #ifndef TIRTC_AUDIO_IO_ANDROID_H_
2
+ #define TIRTC_AUDIO_IO_ANDROID_H_
3
+
4
+ #include "tirtc/audio_io.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ #if defined(__ANDROID__)
11
+ TirtcError tirtc_audio_android_create_open_sl_ain(TirtcAudioAin** out_ain);
12
+ TirtcError tirtc_audio_android_create_open_sl_aout(TirtcAudioAout** out_aout);
13
+ #endif
14
+
15
+ #ifdef __cplusplus
16
+ }
17
+ #endif
18
+
19
+ #endif // TIRTC_AUDIO_IO_ANDROID_H_
@@ -0,0 +1,19 @@
1
+ #ifndef TIRTC_AUDIO_IO_APPLE_H_
2
+ #define TIRTC_AUDIO_IO_APPLE_H_
3
+
4
+ #include "tirtc/audio_io.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ #if defined(__APPLE__)
11
+ TirtcError tirtc_audio_apple_create_audio_toolbox_ain(TirtcAudioAin** out_ain);
12
+ TirtcError tirtc_audio_apple_create_audio_queue_aout(TirtcAudioAout** out_aout);
13
+ #endif
14
+
15
+ #ifdef __cplusplus
16
+ }
17
+ #endif
18
+
19
+ #endif // TIRTC_AUDIO_IO_APPLE_H_
@@ -0,0 +1,19 @@
1
+ #ifndef TIRTC_AUDIO_IO_HARMONY_H_
2
+ #define TIRTC_AUDIO_IO_HARMONY_H_
3
+
4
+ #include "tirtc/audio_io.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ #if defined(__OHOS__)
11
+ TirtcError tirtc_audio_harmony_create_open_sl_ain(TirtcAudioAin** out_ain);
12
+ TirtcError tirtc_audio_harmony_create_audio_render_aout(TirtcAudioAout** out_aout);
13
+ #endif
14
+
15
+ #ifdef __cplusplus
16
+ }
17
+ #endif
18
+
19
+ #endif // TIRTC_AUDIO_IO_HARMONY_H_
@@ -0,0 +1,19 @@
1
+ #ifndef TIRTC_AUDIO_IO_WINDOWS_H_
2
+ #define TIRTC_AUDIO_IO_WINDOWS_H_
3
+
4
+ #include "tirtc/audio_io.h"
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ #if defined(_WIN32)
11
+ TirtcError tirtc_audio_windows_create_wasapi_ain(TirtcAudioAin** out_ain);
12
+ TirtcError tirtc_audio_windows_create_wave_out_aout(TirtcAudioAout** out_aout);
13
+ #endif
14
+
15
+ #ifdef __cplusplus
16
+ }
17
+ #endif
18
+
19
+ #endif // TIRTC_AUDIO_IO_WINDOWS_H_
@@ -0,0 +1,56 @@
1
+ #ifndef TIRTC_AUDIO_PROCESSING_H_
2
+ #define TIRTC_AUDIO_PROCESSING_H_
3
+
4
+ #include "tirtc/audio_frame.h"
5
+ #include "tirtc/error.h"
6
+
7
+ #ifdef __cplusplus
8
+ extern "C" {
9
+ #endif
10
+
11
+ typedef struct TirtcAudioProcessor TirtcAudioProcessor;
12
+
13
+ typedef enum TirtcAudioAecMode {
14
+ TIRTC_AUDIO_AEC_MODE_DISABLED = 0,
15
+ TIRTC_AUDIO_AEC_MODE_ENABLED = 1,
16
+ } TirtcAudioAecMode;
17
+
18
+ typedef enum TirtcAudioAnsLevel {
19
+ TIRTC_AUDIO_ANS_LEVEL_DISABLED = 0,
20
+ TIRTC_AUDIO_ANS_LEVEL_LOW = 1,
21
+ TIRTC_AUDIO_ANS_LEVEL_MEDIUM = 2,
22
+ TIRTC_AUDIO_ANS_LEVEL_HIGH = 3,
23
+ } TirtcAudioAnsLevel;
24
+
25
+ typedef enum TirtcAudioAgcLevel {
26
+ TIRTC_AUDIO_AGC_LEVEL_DISABLED = 0,
27
+ TIRTC_AUDIO_AGC_LEVEL_LOW = 1,
28
+ TIRTC_AUDIO_AGC_LEVEL_MEDIUM = 2,
29
+ TIRTC_AUDIO_AGC_LEVEL_HIGH = 3,
30
+ } TirtcAudioAgcLevel;
31
+
32
+ typedef struct TirtcAudioProcessorConfig {
33
+ TirtcAudioSampleRate sample_rate;
34
+ TirtcAudioAecMode aec_mode;
35
+ TirtcAudioAnsLevel ans_level;
36
+ TirtcAudioAgcLevel agc_level;
37
+ } TirtcAudioProcessorConfig;
38
+
39
+ TirtcError tirtc_audio_processor_create(const TirtcAudioProcessorConfig* config,
40
+ TirtcAudioProcessor** out_processor);
41
+ void tirtc_audio_processor_destroy(TirtcAudioProcessor* processor);
42
+
43
+ TirtcError tirtc_audio_processor_set_config(TirtcAudioProcessor* processor,
44
+ const TirtcAudioProcessorConfig* config);
45
+
46
+ TirtcError tirtc_audio_processor_process(TirtcAudioProcessor* processor,
47
+ const TirtcAudioPcmFrame* in_frame,
48
+ TirtcAudioPcmFrame* out_frame);
49
+
50
+ TirtcError tirtc_audio_processor_reset(TirtcAudioProcessor* processor);
51
+
52
+ #ifdef __cplusplus
53
+ }
54
+ #endif
55
+
56
+ #endif // TIRTC_AUDIO_PROCESSING_H_
@@ -0,0 +1,18 @@
1
+ #ifndef TIRTC_MEDIA_CONTRACT_AUDIO_SAMPLE_RATE_H_
2
+ #define TIRTC_MEDIA_CONTRACT_AUDIO_SAMPLE_RATE_H_
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ typedef enum TirtcAudioSampleRate {
9
+ TIRTC_AUDIO_SAMPLE_RATE_NONE = 0,
10
+ TIRTC_AUDIO_SAMPLE_RATE_8K = 8000,
11
+ TIRTC_AUDIO_SAMPLE_RATE_16K = 16000,
12
+ } TirtcAudioSampleRate;
13
+
14
+ #ifdef __cplusplus
15
+ }
16
+ #endif
17
+
18
+ #endif // TIRTC_MEDIA_CONTRACT_AUDIO_SAMPLE_RATE_H_