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:
@@ -1,6 +1,7 @@
|
|||||||
export interface OB11Config {
|
export interface OB11Config {
|
||||||
httpPort: number
|
httpPort: number
|
||||||
httpHosts: string[]
|
httpHosts: string[]
|
||||||
|
httpSecret?: string
|
||||||
wsPort: number
|
wsPort: number
|
||||||
wsHosts: string[]
|
wsHosts: string[]
|
||||||
enableHttp?: boolean
|
enableHttp?: boolean
|
||||||
|
@@ -116,7 +116,6 @@ export async function encodeSilk(filePath: string) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const fileName = path.basename(filePath);
|
|
||||||
const pttPath = path.join(DATA_DIR, uuidv4());
|
const pttPath = path.join(DATA_DIR, uuidv4());
|
||||||
if (getFileHeader(filePath) !== "02232153494c4b") {
|
if (getFileHeader(filePath) !== "02232153494c4b") {
|
||||||
log(`语音文件${filePath}需要转换成silk`)
|
log(`语音文件${filePath}需要转换成silk`)
|
||||||
@@ -151,7 +150,7 @@ export async function encodeSilk(filePath: string) {
|
|||||||
fs.writeFileSync(pttPath, silk.data);
|
fs.writeFileSync(pttPath, silk.data);
|
||||||
fs.unlink(wavPath, (err) => {
|
fs.unlink(wavPath, (err) => {
|
||||||
});
|
});
|
||||||
const duration = verifyDuration(silk.duration, await guessDuration(filePath))
|
const duration = verifyDuration(silk.duration / 1000, await guessDuration(filePath))
|
||||||
return {
|
return {
|
||||||
converted: true,
|
converted: true,
|
||||||
path: pttPath,
|
path: pttPath,
|
||||||
|
Reference in New Issue
Block a user