Commit 6dfa7138 authored by martin hou's avatar martin hou

增加对第5版文件时长计算的兼容处理

parent ef0d2568
......@@ -170,7 +170,7 @@ export function Home() {
<h3>Files: </h3>
<ol style={{ padding: '0px 0px 0px 30px', 'listStyle': 'none' }}>
{ files.map((item, index) => {
return <li>{index} - {item.name}, {item.length}</li>
return <li key={item.name}>{index} - {item?.name}, {item?.length} @ {item.duration}</li>
})}
</ol>
</div>
......
......@@ -677,16 +677,27 @@ Jensen.prototype.listFiles = async function () {
ftime = ftime.replace(/^(\d{2})?(\d{2})(\w{3})(\d{2})-(\d{2})(\d{2})(\d{2})-.*\.(hda|wav)$/gi, '20$2 $3 $4 $5:$6:$7');
ftime = new Date(ftime);
duration = (flen / 32) * 4;
} else {
}
else
{
ftime = null;
}
if (ver == 1) {
if (ver == 1)
{
duration = duration * 2;
} else if (ver == 2) {
}
else if (ver == 2)
{
duration = (flen - 44) / 48 / 2;
} else if (ver == 3) {
}
else if (ver == 3)
{
duration = (flen - 44) / 48 / 2 / 2;
}
else if (ver == 5)
{
duration = flen / 12;
}
let createDate = '';
let createTime = '';
if (ftime) {
......
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