[中] 音频预览生成的临时 WAV 从不删除
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 68/100
Research direction
Start at render_audio_preview() in windows/birdlock/app/state.py (1292-1322), where tempfile.mkstemp() writes the WAV, then follow _audio_wav_cache through _start_audio() (:788) and :1243), which drops the dict without unlinking. Compare the temp-file handling in clear() (windows/birdlock/core/exporter.py:492-503 before choosing either a fixed preview filename or an unlink-on-clear/close map. Done looks like previewing several segments, then finding no leftover WAVs in the temp directory and playback still working after the cache is emptied.
Written by the indexing model from the issue text.
Description
位置:windows/birdlock/app/state.py:1292-1322、:788、:1243;windows/birdlock/core/exporter.py:492-503
现象:render_audio_preview() 用 tempfile.mkstemp() 在系统临时目录生成 WAV,_start_audio() 只把路径放进 _audio_wav_cache;clear() 只清字典不删文件。每次在不同位置开始预览都会留下一个文件,缓存被系统清理后还会导致 _play_wav() 静默失败。
复现:反复播放不同片段后检查系统临时目录。
建议:改用固定命名的预览文件并在替换/关闭时删除,或维护映射并在 clear/close 时逐个 unlink。
来源:2026-11-15 全仓只读审计,PR #7 未包含此项。 未在 Windows 实机复现,复现路径由代码审计推得。
- Dominant language
- Swift
- Stars
- 2
- Forks
- 2
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 cyandee/BirdLock
-
Difficulty 2/5 Under an hour Newbie friendliness 62/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100