style: lint

This commit is contained in:
手瓜一十雪
2024-09-17 13:15:12 +08:00
parent 8c33b640b0
commit c11e88ecf1
8 changed files with 23 additions and 23 deletions

View File

@@ -45,9 +45,9 @@ async function handleWavFile(
): Promise<{input: Buffer, sampleRate: number}> {
const { fmt } = getWavFileInfo(file);
if (!ALLOW_SAMPLE_RATE.includes(fmt.sampleRate)) {
return {input: await convert(filePath, pcmPath, logger), sampleRate: 24000};
return { input: await convert(filePath, pcmPath, logger), sampleRate: 24000 };
}
return {input: file, sampleRate: fmt.sampleRate};
return { input: file, sampleRate: fmt.sampleRate };
}
export async function encodeSilk(filePath: string, TEMP_DIR: string, logger: LogWrapper) {
@@ -59,7 +59,7 @@ export async function encodeSilk(filePath: string, TEMP_DIR: string, logger: Log
const pcmPath = `${pttPath}.pcm`;
const { input, sampleRate } = isWav(file)
? (await handleWavFile(file, filePath, pcmPath, logger))
: {input: await convert(filePath, pcmPath, logger), sampleRate: 24000};
: { input: await convert(filePath, pcmPath, logger), sampleRate: 24000 };
const silk = await encode(input, sampleRate);
await fsPromise.writeFile(pttPath, silk.data);
logger.log(`语音文件${filePath}转换成功!`, pttPath, '时长:', silk.duration);

View File

@@ -187,7 +187,7 @@ export class NTEventWrapper {
const id = randomUUID();
let complete = 0;
let retData: Parameters<ListenerType> | undefined = undefined;
let retEvent: any = {};
const retEvent: any = {};
function sendDataCallback() {
if (complete == 0) {

View File

@@ -144,7 +144,7 @@ async function tryDownload(options: string | HttpDownloadOptions, useReferer: bo
}
if (useReferer && !headers['Referer']) {
headers['Referer'] = url;
};
}
const fetchRes = await fetch(url, { headers }).catch((err) => {
if (err.cause) {
throw err.cause;

View File

@@ -55,23 +55,23 @@ export class QQBasicInfoWrapper {
//此方法不要直接使用
getQUAInternal() {
switch (systemPlatform) {
case 'linux':
return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
case 'darwin':
return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
default:
return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
case 'linux':
return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
case 'darwin':
return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
default:
return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`;
}
}
getAppidInternal() {
switch (systemPlatform) {
case 'linux':
return '537246140';
case 'darwin':
return '537246140';
default:
return '537246092';
case 'linux':
return '537246140';
case 'darwin':
return '537246140';
default:
return '537246092';
}
}