这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions scripts/termux-microphone-record
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ show_usage () {
echo "-h Shows this help"
echo "-d Start recording w/ defaults"
echo "-f <file> Start recording to specific file"
echo "-l <limit> Start recording w/ specified limit (in seconds)"
echo "-l <limit> Start recording w/ specified limit (in seconds, unlimited for 0)"
echo "-e <encoder> Start recording w/ specified encoder (aac, amr_wb, amr_nb)"
echo "-b <bitrate> Start recording w/ specified bitrate (in kbps)"
echo "-r <rate> Start recording w/ specified sampling rate (in Hz)"
echo "-c <count> Start recording w/ specified channel count (1, 2, ...)"
echo "-i Get info about current recording"
echo "-q Quits recording"
}
Expand Down Expand Up @@ -38,7 +42,7 @@ call_api () {
/data/data/com.termux/files/usr/libexec/termux-api MicRecorder "$@"
}

while getopts h,f:,l:,d,i,q option
while getopts h,f:,l:,e:,b:,r:,c:,d,i,q option
do
case "$option" in
h) sole "$@"
Expand All @@ -55,6 +59,19 @@ do
;;
d) record=yes
;;
e) record=yes
add_params --es encoder "$OPTARG"
;;
# API takes bitrate in bps
b) record=yes
add_params --ei bitrate $((OPTARG * 1000))
;;
r) record=yes
add_params --ei srate $((OPTARG))
;;
c) record=yes
add_params --ei channels $((OPTARG))
;;
i) sole "$@"
add_params -a info
;;
Expand Down