Nick Payne
56ac954369
Merge pull request #13 from makeusabrew/performance-optimisations
...
Performance optimisations
2026-03-31 14:12:49 +01:00
Nick Payne
81436f42c6
add talat feature
2026-03-31 14:10:10 +01:00
Nick Payne
a1eb465142
zero-alloc audio pipeline: pointer-based IO from ring buffer to stdout
...
Replace Data/AudioPacket allocations with raw pointer callbacks through
the entire audio pipeline. Ring buffer hands out direct pointers (or
linearizes into a pre-allocated scratch buffer on wrap-around), converter
accepts/emits pointers via its cached buffers, and output handler writes
to stdout via write(2) with EINTR handling.
Remove AudioPacket (dead code), --flush flag (no-op with raw write(2)).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-07 07:14:16 +00:00
Nick Payne
65c2d58c82
remove unused append(_ data: Data) overload from AudioBuffer
...
Only one append path exists now: append(from:count:), which is what the
IO proc callback uses. The Data-based overload had no callers in source
and added a dead code path to maintain.
Also resolves CoreAudio.AudioBuffer name collision in tests via typealias.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-06 21:38:14 +00:00
Nick Payne
85975d6cc3
optimise hot-path audio pipeline: zero-copy ring buffer, pre-allocated converter buffers
...
- Replace Swift Array<UInt8> ring buffer with UnsafeMutableRawPointer to
eliminate COW ref-count checks on every write/read
- Add append(from:count:) to copy directly from Core Audio buffer pointer
into the ring buffer, removing the per-callback Data heap allocation
- Pre-allocate AVAudioPCMBuffer pair in AudioFormatConverter and reuse
across transform() calls (lazy init, capacity-checked)
- Fix float-to-int truncation in output frame count calculation (ceil)
- Add comprehensive AudioBuffer test suite (12 tests) including proper
wrap-around coverage for both append and read paths
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-06 21:32:42 +00:00
Nick Payne
1cd2e83060
Merge pull request #12 from makeusabrew/lib-improvements
...
library improvements
2026-03-01 11:09:09 +00:00
Nick Payne
4600e34bfb
Merge pull request #11 from makeusabrew/lib-split-cli
...
Split source into library and CLI targets
2026-02-26 13:50:24 +00:00
Nick Payne
08f0bc8f6c
library improvements
2026-02-25 20:26:39 +00:00
Nick Payne
c4cf27553a
Merge branch 'main' into lib-split-cli
2026-02-25 16:14:04 +00:00
Nick Payne
087e4b1642
Merge pull request #10 from phritz/add-flush-option
...
Add --flush option to reduce stdout buffering latency
2026-02-25 14:25:46 +00:00
phritz
0b1ba5c8cd
Add --flush option to reduce stdout buffering latency
2026-01-24 10:36:58 -06:00
Nick Payne
b7455d26d1
potential split between CLI and core library
2025-08-19 08:51:14 +01:00
Nick Payne
a311cc583f
simplify recorder
2025-08-12 13:37:39 +01:00
Nick Payne
8b3de5918c
update readme
2025-08-12 13:37:22 +01:00
Nick Payne
cf7bc88528
update readme
2025-08-12 12:40:03 +01:00
Nick Payne
25f017f319
Merge pull request #6 from na-2n/feature/stereo
...
Add stereo recording option
2025-08-12 12:38:42 +01:00
Nick Payne
307eae147d
remove output PCM
2025-08-12 12:36:24 +01:00
na-2n
c9d11316ff
add stereo recording option
2025-08-10 19:17:08 +02:00
Nick Payne
71b0c45a5c
minor tidyup
2025-07-29 10:14:49 +01:00
Nick Payne
fd82e3d9d9
expand readme details
2025-07-29 07:11:28 +01:00
Nick Payne
d260c7824d
swift format
2025-07-29 07:04:57 +01:00
Nick Payne
b3b11c8649
readme improvements
2025-07-29 06:10:55 +01:00
Nick Payne
00985c0d33
add link to AudioTee.js
2025-07-27 19:12:13 +01:00
Nick Payne
1c94f55a9b
Merge pull request #5 from makeusabrew/stdout-stream
...
Only ever write PCM data to stdout
2025-07-27 19:04:21 +01:00
Nick Payne
2040510e9e
consuming output is already fairly well covered
2025-07-27 10:14:19 +01:00
Nick Payne
3449a9bb9c
further README tweaks
2025-07-27 10:10:36 +01:00
Nick Payne
ac0ae46cfa
update readme
2025-07-27 10:06:01 +01:00
Nick Payne
8c3ee0f4e7
fix build error
2025-07-27 09:55:33 +01:00
Nick Payne
abaa019bd2
only write PCM to stdout
2025-07-27 09:53:26 +01:00
Nick Payne
98e33b7bcb
Merge pull request #3 from makeusabrew/memory-leak
...
Use ring buffer to avoid memory leak
2025-07-12 13:45:41 +01:00
Nick Payne
ee8968e2d6
no need for buffer overflow error
2025-07-12 13:45:25 +01:00
Nick Payne
4bc36019c2
get rid of O(n) ops on hot audio packet path
2025-07-10 20:43:17 +01:00
Nick Payne
1b537eb395
use ring buffer to avoid memory leak
2025-07-10 14:08:52 +01:00
Nick Payne
80d7555b60
Merge pull request #2 from makeusabrew/readiness-test
...
Wait for aggregate device ID to be valid
2025-07-04 09:22:50 +01:00
Nick Payne
c696fa0197
Merge branch 'main' into readiness-test
2025-07-04 08:53:17 +01:00
Nick Payne
a0902f6eec
remove swift-argument-parser - it was adding well over 1Mb of bloat to release builds
2025-07-02 20:58:28 +01:00
Nick Payne
b7ce5e61d8
Merge branch 'main' into readiness-test
2025-07-02 16:48:35 +01:00
Nick Payne
d10f16a119
if a sample rate conversion is requested, always honour it
2025-07-02 16:48:28 +01:00
Nick Payne
a7be157d06
attempt to wait for device readiness
2025-07-02 16:13:38 +01:00
Nick Payne
bfce968fb6
slightly better zeroes explanation.
2025-06-21 09:52:09 +01:00
Nick Payne
95f11b17c7
add a note about no audio zero encoding
2025-06-21 09:44:39 +01:00
Nick Payne
756c1b3535
a few readme clarifications
2025-06-21 09:41:20 +01:00
Nick Payne
fcbf9b0097
rename --convert-to to --sample-rate
2025-06-17 16:53:55 +01:00
Nick Payne
0f550157ae
more logical CLI options
2025-06-17 16:48:45 +01:00
Nick Payne
212191648c
add a note about format
2025-06-17 13:39:31 +01:00
Nick Payne
169fe595a6
rename AudioPacketMetadata to BinaryPacketHeader
2025-06-17 10:52:09 +01:00
Nick Payne
51c1cdf85f
small README adjustments
2025-06-16 20:39:47 +01:00
Nick Payne
4a8bc657e3
AudioTee Swift CLI repo
2025-06-16 20:30:15 +01:00