The master's voice monitoring menu sends COMMAND_AUDIO; the client opens a ConnAuth sub-connection with TOKEN_AUDIO_START, the server opens CAudioDlg and answers COMMAND_NEXT, then audio flows both ways. The protocol matches the Windows client, so the server needs no changes. The server's ACM format was read from Audio.cpp and AudioDlg.cpp first: WAVE_FORMAT_GSM610, 8000 Hz mono, 65-byte blocks of 320 samples (40 ms), about 1625 B/s. libgsm 1.0.13 (AOSP external/libgsm mirror) is vendored under cpp/gsm and built with -DSASR -DWAV49 so its MS-GSM packing is byte-identical to ACM GSM610. Encode and decode use separate gsm states because frame_index/frame_chain live in the state. Uplink packets are always exactly 1000 bytes: CAudio::PlayBuffer copies 1000 bytes from the buffer start regardless of packet length, so a short packet would over-read. Since 1000 is not a multiple of 65, blocks straddle packets; the stream is continuous and codec state carries over. AudioMonitor.kt owns AudioRecord (8 kHz/16-bit/mono, 320 samples a read) and AudioTrack playback of decoded downlink PCM. RECORD_AUDIO is requested with POST_NOTIFICATIONS before the projection dialog, and CaptureService adds the microphone FGS type only when held, falling back on failure. An 8-second dialog wait or missing microphone reports a tip to the master instead of failing silently. Verified on an Android 15 emulator against the Debug server: dialog opened, uplink started, server receive counter grew at ~1.6 KB/s. Downlink playback was not exercised (the test machine has no recording device); that path is code-reviewed only. Co-Authored-By: deepseek-flash
66 lines
1.6 KiB
C
66 lines
1.6 KiB
C
/*
|
|
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
|
|
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
|
|
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
|
|
*/
|
|
|
|
/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/proto.h,v 1.1 1992/10/28 00:11:08 jutta Exp $*/
|
|
|
|
#ifndef PROTO_H
|
|
#define PROTO_H
|
|
|
|
#if __cplusplus
|
|
# define NeedFunctionPrototypes 1
|
|
#endif
|
|
|
|
#if __STDC__
|
|
# define NeedFunctionPrototypes 1
|
|
#endif
|
|
|
|
#ifdef _NO_PROTO
|
|
# undef NeedFunctionPrototypes
|
|
#endif
|
|
|
|
#undef P /* gnu stdio.h actually defines this... */
|
|
#undef P0
|
|
#undef P1
|
|
#undef P2
|
|
#undef P3
|
|
#undef P4
|
|
#undef P5
|
|
#undef P6
|
|
#undef P7
|
|
#undef P8
|
|
|
|
#if NeedFunctionPrototypes
|
|
|
|
# define P( protos ) protos
|
|
|
|
# define P0() (void)
|
|
# define P1(x, a) (a)
|
|
# define P2(x, a, b) (a, b)
|
|
# define P3(x, a, b, c) (a, b, c)
|
|
# define P4(x, a, b, c, d) (a, b, c, d)
|
|
# define P5(x, a, b, c, d, e) (a, b, c, d, e)
|
|
# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f)
|
|
# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g)
|
|
# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h)
|
|
|
|
#else /* !NeedFunctionPrototypes */
|
|
|
|
# define P( protos ) ( /* protos */ )
|
|
|
|
# define P0() ()
|
|
# define P1(x, a) x a;
|
|
# define P2(x, a, b) x a; b;
|
|
# define P3(x, a, b, c) x a; b; c;
|
|
# define P4(x, a, b, c, d) x a; b; c; d;
|
|
# define P5(x, a, b, c, d, e) x a; b; c; d; e;
|
|
# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f;
|
|
# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g;
|
|
# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h;
|
|
|
|
#endif /* !NeedFunctionPrototypes */
|
|
|
|
#endif /* PROTO_H */
|