Skip to content

Commit 7903cdf

Browse files
committed
audio-mon
1 parent ff2f7ca commit 7903cdf

File tree

5 files changed

+430
-11
lines changed

5 files changed

+430
-11
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ add_executable(audio_consumer
7878
)
7979
target_link_libraries(audio_consumer rt pthread)
8080

81+
add_executable(audio_mon
82+
examples/audio_mon.cpp
83+
)
84+
target_link_libraries(audio_mon rt pthread)
85+
8186
# GNUInstallDirs for proper FHS-compliant paths
8287
include(GNUInstallDirs)
8388

@@ -87,7 +92,7 @@ install(TARGETS ws-audiod
8792
)
8893

8994
# Install example executables
90-
install(TARGETS clip_client audio_consumer
95+
install(TARGETS clip_client audio_consumer audio_mon
9196
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
9297
)
9398

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,15 @@ infrastructure without reimplementing low-level ALSA capture and distribution lo
6262
│ (PCM) │ └──────────────┘
6363
└──────┬───────┘
6464
65-
┌────┴────┐
66-
▼ ▼
67-
┌────────┐ ┌──────────┐
68-
│ SHM │ │ TCP/HTTP │
69-
│Publisher│ │ Streamer │
70-
└────────┘ └──────────┘
71-
│ │
72-
▼ ▼
73-
Consumer Remote
74-
processes clients
65+
66+
┌────────┐
67+
│ SHM │
68+
│Publisher│
69+
└────────┘
70+
71+
72+
Consumer
73+
processes
7574
```
7675

7776
## Building from Source
@@ -183,6 +182,17 @@ Shared memory consumer (zero-copy):
183182
python3 examples/audio_client.py stream
184183
```
185184

185+
### Audio Monitor
186+
187+
`audio_mon` provides a live terminal level meter with gain control:
188+
189+
```bash
190+
./audio_mon # connect to default shm
191+
./audio_mon -s /ws_audiod_samples -S /run/ws-audiod/control.sock
192+
```
193+
194+
Use **UP/+** and **DOWN/-** to adjust mic boost in 1 dB steps, **q** to quit.
195+
186196
## Configuration
187197

188198
`/etc/ws/audiod/ws-audiod.conf`:

debian/audio_mon.1

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.TH AUDIO_MON 1 "March 2026" "1.0.0" "ws-audiod"
2+
.SH NAME
3+
audio_mon \- real-time terminal audio monitor for ws\-audiod
4+
.SH SYNOPSIS
5+
.B audio_mon
6+
.RB [ \-s
7+
.IR shm_name ]
8+
.RB [ \-S
9+
.IR socket_path ]
10+
.RB [ \-h ]
11+
.SH DESCRIPTION
12+
.B audio_mon
13+
reads audio samples from the ws\-audiod shared memory region and displays
14+
a live per-channel level meter in the terminal. It also allows adjusting the
15+
daemon's mic boost (gain) via keyboard controls.
16+
.PP
17+
Requires the daemon to be running with \fBenable_sample_sharing=true\fR.
18+
.SH OPTIONS
19+
.TP
20+
.BR \-s ", " \-\-shm " " \fINAME\fR
21+
Shared memory segment name (default: /ws_audiod_samples).
22+
.TP
23+
.BR \-S ", " \-\-socket " " \fIPATH\fR
24+
Control socket path (default: /run/ws\-audiod/control.sock).
25+
.TP
26+
.BR \-h ", " \-\-help
27+
Show usage information and exit.
28+
.SH KEYBOARD CONTROLS
29+
.TP
30+
.BR UP " / " +
31+
Increase mic boost by 1 dB.
32+
.TP
33+
.BR DOWN " / " \-
34+
Decrease mic boost by 1 dB.
35+
.TP
36+
.B q
37+
Quit.
38+
.SH AUTHOR
39+
Ed Baker <ed@ebaker.me.uk>

debian/ws-audiod.manpages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
debian/ws-audiod.1
22
debian/clip_client.1
33
debian/audio_consumer.1
4+
debian/audio_mon.1

0 commit comments

Comments
 (0)