mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: auto create temp dir
This commit is contained in:
parent
ebca6a07c5
commit
6a8c5ec24a
@ -1,6 +1,7 @@
|
||||
export interface OB11Config {
|
||||
httpPort: number
|
||||
httpHosts: string[]
|
||||
httpSecret?: string
|
||||
wsPort: number
|
||||
wsHosts: string[]
|
||||
enableHttp?: boolean
|
||||
|
@ -116,7 +116,6 @@ export async function encodeSilk(filePath: string) {
|
||||
// }
|
||||
|
||||
try {
|
||||
const fileName = path.basename(filePath);
|
||||
const pttPath = path.join(DATA_DIR, uuidv4());
|
||||
if (getFileHeader(filePath) !== "02232153494c4b") {
|
||||
log(`语音文件${filePath}需要转换成silk`)
|
||||
@ -151,7 +150,7 @@ export async function encodeSilk(filePath: string) {
|
||||
fs.writeFileSync(pttPath, silk.data);
|
||||
fs.unlink(wavPath, (err) => {
|
||||
});
|
||||
const duration = verifyDuration(silk.duration, await guessDuration(filePath))
|
||||
const duration = verifyDuration(silk.duration / 1000, await guessDuration(filePath))
|
||||
return {
|
||||
converted: true,
|
||||
path: pttPath,
|
||||
|
Loading…
x
Reference in New Issue
Block a user