Commit b101ec74 authored by martin hou's avatar martin hou

feat: 增加对ver=7版本的录音时长计算支持

parent 5eeb0bfd
......@@ -114,6 +114,9 @@ export function Home() {
let fc = await jensen.getFileCount();
// alert(fc?.count);
let files = await jensen.listFiles();
files.sort((a, b) => {
return b.time.getTime() - a.time.getTime();
});
console.log(files);
setFiles(files)
}
......@@ -267,7 +270,7 @@ export function Home() {
<h3>Files: </h3>
<ol style={{ padding: '0px 0px 0px 30px', 'listStyle': 'none' }}>
{ files.map((item, index) => {
return <li key={item.name}>{index} - {item?.name}, {item?.length} @ {item.duration}</li>
return <li key={item.name}>{index} - {item?.name}, {item?.length} @ {Math.floor(item.duration / 1000 / 60)} mins</li>
})}
</ol>
</div>
......
......@@ -798,6 +798,10 @@ Jensen.prototype.listFiles = async function () {
{
duration = flen / 16;
}
else if (ver == 7)
{
duration = flen / 10;
}
// "2025Sep24-180808-Call01.hda"
mode = fname.join('').replace(/^(\w{9})-(\d{6})-(.+?)\d+\.\w+$/gi, '$3').toUpperCase();
console.log('mode:', fname.join(''), mode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment