termux / termux/termux-api

`termux-microphone-record -d` twice will got wrong outputFile

Open
#808 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Problem description
run termux-microphone-record -d twice will got wrong outputFile

Steps to reproduce

//1. check current recording
~ $ termux-microphone-record -i
{
  "isRecording": true,
  "outputFile": "\/storage\/emulated\/0\/TermuxAudioRecording_2025-09-30_21-00-01.ogg"
}

//2. call recording again
~ $ termux-microphone-record -d -e opus

Recording already in progress!

//3. info tell current file is changed, wrongly (acturely old recording still use old file)
~ $ termux-microphone-record -i
{
  "isRecording": true,
  "outputFile": "\/storage\/emulated\/0\/TermuxAudioRecording_2025-09-30_21-07-05.ogg"
}
~ $ ls -lhtr /sdcard/TermuxAudioRecording_2025-09-30_* | tail -2
-rw-rw----. 1 root everybody 2.2M Sep 30 21:00 /sdcard/TermuxAudioRecording_2025-09-30_20-45-01.ogg
-rw-rw----. 1 root everybody 1.1M Sep 30 21:07 /sdcard/TermuxAudioRecording_2025-09-30_21-00-01.ogg

//4. `ls -lh` multi times, we can see old file still growing, that's meaning old file still in-use.

Expected behavior
outputFile should return the old file which really in-use.

Additional information

  • termux-api application version: com.termux.api versionCode:1002
  • termux-api package version (installed through apt): 0.59.1-1
  • Android OS version: 10
  • Device model: MI 9

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the termux-microphone-record entry point and reproduce the two recording commands, then trace how the active recording and outputFile are reported. Done means a second start attempt leaves the reported outputFile pointing to the file that is still growing.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
api, cli, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.