Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jensen
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Skye Yu
jensen
Commits
e16f1a2a
Commit
e16f1a2a
authored
Feb 04, 2026
by
martin hou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加对录音状态新指令的兼容
parent
b1e07455
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
jensen.d.ts
jensen.d.ts
+1
-1
index.tsx
src/index.tsx
+11
-0
jensen.js
src/utils/jensen.js
+6
-5
No files found.
jensen.d.ts
View file @
e16f1a2a
...
@@ -344,7 +344,7 @@ declare class Jensen {
...
@@ -344,7 +344,7 @@ declare class Jensen {
sendKeyCode
:
(
mode
:
number
,
keyCode
:
number
,
seconds
?:
number
)
=>
Promise
<
ReturnStruct
[
'common'
]
>
;
sendKeyCode
:
(
mode
:
number
,
keyCode
:
number
,
seconds
?:
number
)
=>
Promise
<
ReturnStruct
[
'common'
]
>
;
// 获取录音状态
// 获取录音状态
getRecordingStatus
:
(
seconds
?:
number
)
=>
Promise
<
{
recording
:
null
|
string
;
duration
:
number
;
samples
:
number
[]
}
>
;
getRecordingStatus
:
(
seconds
?:
number
)
=>
Promise
<
{
recording
:
null
|
string
;
duration
:
number
;
samples
:
number
[]
,
type
:
'recording'
|
'whisper'
|
null
}
>
;
// 获取录音质量
// 获取录音质量
getRecordingQuality
:
(
seconds
?:
number
)
=>
Promise
<
{
quality
:
'normal'
|
'high'
}
>
;
getRecordingQuality
:
(
seconds
?:
number
)
=>
Promise
<
{
quality
:
'normal'
|
'high'
}
>
;
...
...
src/index.tsx
View file @
e16f1a2a
...
@@ -812,6 +812,16 @@ export function Home() {
...
@@ -812,6 +812,16 @@ export function Home() {
await
releaseJensen
();
await
releaseJensen
();
}
}
const
switchAutoRecord
=
async
()
=>
{
let
jensen
=
await
getJensen
();
if
(
jensen
==
null
)
return
;
const
current
=
await
jensen
.
getSettings
(
5
);
Logger
.
info
(
'jensen'
,
'auto-record'
,
'Current Auto Record: '
+
JSON
.
stringify
(
current
));
let
rst
=
await
jensen
.
setAutoRecord
(
true
,
5
);
Logger
.
info
(
'jensen'
,
'auto-record'
,
'Set Auto Record: '
+
JSON
.
stringify
(
rst
));
await
releaseJensen
();
}
return
(
return
(
<>
<>
<
div
className=
"btn-container"
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
<
div
className=
"btn-container"
style=
{
{
display
:
'flex'
,
flexDirection
:
'row'
,
gap
:
'16px'
,
padding
:
'16px'
,
alignItems
:
'center'
,
flexWrap
:
'wrap'
}
}
>
...
@@ -842,6 +852,7 @@ export function Home() {
...
@@ -842,6 +852,7 @@ export function Home() {
<
button
onClick=
{
turnPopupOn
}
>
Turn Popup On
</
button
>
<
button
onClick=
{
turnPopupOn
}
>
Turn Popup On
</
button
>
<
button
onClick=
{
turnPopupOff
}
>
Turn Popup Off
</
button
>
<
button
onClick=
{
turnPopupOff
}
>
Turn Popup Off
</
button
>
<
button
onClick=
{
getSettings
}
>
Get Settings
</
button
>
<
button
onClick=
{
getSettings
}
>
Get Settings
</
button
>
<
button
onClick=
{
switchAutoRecord
}
>
Switch Auto Record
</
button
>
<
button
onClick=
{
startLive
}
>
Start Live
</
button
>
<
button
onClick=
{
startLive
}
>
Start Live
</
button
>
<
button
onClick=
{
stopLive
}
>
Stop Live
</
button
>
<
button
onClick=
{
stopLive
}
>
Stop Live
</
button
>
<
button
onClick=
{
muteControl
}
>
{
mute
?
'Muted'
:
'Unmuted'
}
</
button
>
<
button
onClick=
{
muteControl
}
>
{
mute
?
'Muted'
:
'Unmuted'
}
</
button
>
...
...
src/utils/jensen.js
View file @
e16f1a2a
...
@@ -1798,22 +1798,23 @@ Jensen.registerHandler(BT_DEV_LIST, (msg, jensen) => {
...
@@ -1798,22 +1798,23 @@ Jensen.registerHandler(BT_DEV_LIST, (msg, jensen) => {
});
});
Jensen
.
registerHandler
(
GET_RECORDING_STATUS
,
(
msg
)
=>
{
Jensen
.
registerHandler
(
GET_RECORDING_STATUS
,
(
msg
)
=>
{
if
(
msg
.
body
.
length
==
0
)
return
null
;
if
(
msg
.
body
.
length
==
0
)
return
{
recording
:
null
,
duration
:
0
,
samples
:
[],
type
:
null
}
;
let
fname
=
''
;
let
fname
=
''
;
let
idx
=
0
;
let
idx
=
0
;
let
len
=
((
msg
.
body
[
idx
++
]
&
0xff
)
<<
8
)
||
(
msg
.
body
[
idx
++
]
&
0xff
);
const
type
=
msg
.
body
[
idx
++
]
&
0xff
;
let
len
=
(
msg
.
body
[
idx
++
]
&
0xff
);
for
(
let
i
=
0
;
i
<
len
&&
i
<
msg
.
body
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
len
&&
i
<
msg
.
body
.
length
;
i
++
)
{
fname
+=
String
.
fromCharCode
(
msg
.
body
[
idx
++
]
&
0xff
);
fname
+=
String
.
fromCharCode
(
msg
.
body
[
idx
++
]
&
0xff
);
}
}
// 录音时长
// 录音时长
let
duration
=
((
msg
.
body
[
idx
+
1
]
&
0xff
)
<<
8
)
||
(
msg
.
body
[
idx
+
2
]
&
0xff
);
let
duration
=
((
msg
.
body
[
idx
+
+
]
&
0xff
)
<<
8
)
||
(
msg
.
body
[
idx
++
]
&
0xff
);
// 声音采样
// 声音采样
len
=
(
(
msg
.
body
[
idx
++
]
&
0xff
)
<<
8
)
||
(
msg
.
body
[
idx
++
]
&
0xff
);
len
=
(
msg
.
body
[
idx
++
]
&
0xff
);
let
samples
=
[];
let
samples
=
[];
for
(
let
i
=
0
;
i
<
len
&&
i
<
msg
.
body
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
len
&&
i
<
msg
.
body
.
length
;
i
++
)
{
samples
.
push
(
msg
.
body
[
idx
++
]
&
0xff
);
samples
.
push
(
msg
.
body
[
idx
++
]
&
0xff
);
}
}
return
{
recording
:
fname
,
duration
:
duration
,
samples
:
samples
};
return
{
recording
:
fname
,
duration
:
duration
,
samples
:
samples
,
type
:
type
==
0x00
?
'recording'
:
'whisper'
};
});
});
Jensen
.
registerHandler
(
GET_RECORDING_QUALITY
,
(
msg
)
=>
{
Jensen
.
registerHandler
(
GET_RECORDING_QUALITY
,
(
msg
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment