Follow the default device and microphone activity by listener
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- audio-video-rtc, backend
Research direction
Read AGENTS.md, docs/standards/testing.md, ROADMAP.md, and the two Python adapter files named in the issue to learn the project’s audio contracts. First check that prerequisite #119 is closed; the issue says not to start until it is. Then locate the two modules and their tests in aitts-audio-coreaudio; done means listener based default output following and per process microphone activity meet the acceptance criteria, with tests and a record in docs/testing-evidence/.
Written by the indexing model from the issue text.
Description
.dag: issue-dag/2
.id: flyingrobots/AI-TTS#129
.kind: task
task: coreaudio-listeners
title: "Follow the default device and microphone activity by listener"
.type: feature
workstream: Audio
wave: 1
.blocked_by: [flyingrobots/AI-TTS#119]
roadmap: ROADMAP.md
language: ASD-STE100
Feature
Do this task in the flyingrobots/AI-TTS repository: Add default-output following and microphone-activity reports to `aitts-audio-coreaudio`, with property listeners in place of polls.
Read these first: AGENTS.md, docs/standards/testing.md, ROADMAP.md, and src/aitts/adapters/core_audio.py, src/aitts/application/audio_device.py.
Do not start until each issue in the Prerequisites section is closed.
Stay in the Scope section. Do not change what the Scope section excludes.
Write each failing test before the code that makes it pass. Record falsification evidence as the testing standard requires.
Stop when each item in Acceptance Criteria and in Definition of Done is true.
Report what you did, what you verified, and what you did not verify.
1. Background Context
The Python daemon reads Core Audio through ctypes and polls each 150 ms. It does this because PortAudio keeps an old device list.
2. Problem Description
The Rust adapter opens the default device one time. It does not follow a change, and it cannot report microphone activity.
2b. Proposed Solution
Add default_device: a listener on the default output property that tells the player to move. Add input_activity: a listener that reports that an application has an input device open.
2c. Alternatives considered and rejected
- Poll as the Python daemon does: a listener is immediate and uses no timer.
- Use a cross-platform audio library: such a library caused the old device list problem.
2d. Acceptance Criteria
- A change of the default output moves speech to the new device during a clip.
- Microphone activity is reported in less than 200 ms after a different application opens an input device.
- No timer runs while the daemon is idle.
- The contract can express activity for each process, for platforms that can report it.
2e. Test Plan
Golden: A simulated property change calls the listener one time.
Edges: The default device is removed. Two changes arrive in 10 ms. No input device exists.
Known failure modes: A listener that is not removed keeps a callback to freed state.
Fuzz and stress: Random sequences of device changes leave one open stream.
3. Prerequisites
- #119 Validate the Rust output process on real audio hardware
4. Scope
In: Two modules in aitts-audio-coreaudio and their tests.
Out: Adapters for other platforms.
5. Why now
The player and the duplex adapter depend on it.
6. Risks
Listener callbacks arrive on a system thread. They must only send a message.
7. Definition of Done
Each acceptance criterion is true. The tests are in the repository and pass in CI. A record is in docs/testing-evidence/. The change is merged. This issue is closed.
8. Stakeholders
- James Ross, the repository owner: decides the scope and accepts the result.
9. Related Issues
- #16
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 51
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from flyingrobots/AI-TTS
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
flyingrobots/AI-TTS#225 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
flyingrobots/AI-TTS#8 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
flyingrobots/AI-TTS#7 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 48/100
flyingrobots/AI-TTS#166 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 38/100
flyingrobots/AI-TTS#165 ·
Maintainers usually reply within 1 day
All issues in flyingrobots/AI-TTS
Similar issues
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdPossibly taken @prathameshfuke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
StingraySoftware/HENDRICS#213 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day