style: format recorder modules
This commit is contained in:
@@ -22,7 +22,8 @@ export class OpusDecoder {
|
||||
this.onData = options.onData;
|
||||
this.createDecoderFn =
|
||||
options.createDecoder ??
|
||||
(() => new prism.opus.Decoder({ frameSize: 960, channels: 2, rate: 48000 }));
|
||||
(() =>
|
||||
new prism.opus.Decoder({ frameSize: 960, channels: 2, rate: 48000 }));
|
||||
}
|
||||
|
||||
rotateIfNeeded(): void {
|
||||
@@ -38,7 +39,10 @@ export class OpusDecoder {
|
||||
try {
|
||||
decoder.write(chunk);
|
||||
} catch (error) {
|
||||
console.warn("[recorder] Opus decoder write failed, cooling down:", error);
|
||||
console.warn(
|
||||
"[recorder] Opus decoder write failed, cooling down:",
|
||||
error,
|
||||
);
|
||||
this.coolDown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,11 @@ export async function collectUserMetadata(
|
||||
member?.roles.cache
|
||||
.filter((role) => role.id !== channel.guild.id)
|
||||
.sort((a, b) => b.position - a.position)
|
||||
.map((role) => ({ id: role.id, name: role.name, position: role.position })) ??
|
||||
[];
|
||||
.map((role) => ({
|
||||
id: role.id,
|
||||
name: role.name,
|
||||
position: role.position,
|
||||
})) ?? [];
|
||||
|
||||
return {
|
||||
userId,
|
||||
|
||||
@@ -33,7 +33,10 @@ export class SegmentManager {
|
||||
open(oggPacketStream: NodeJS.ReadableStream): SegmentState {
|
||||
const index = this.segmentIndex++;
|
||||
const startTime = Date.now();
|
||||
const { filename, jsonFilename } = buildSegmentPaths(this.userDir, startTime);
|
||||
const { filename, jsonFilename } = buildSegmentPaths(
|
||||
this.userDir,
|
||||
startTime,
|
||||
);
|
||||
const oggStream = new prism.opus.OggLogicalBitstream({
|
||||
opusHead: new prism.opus.OpusHead({ channelCount: 2, sampleRate: 48000 }),
|
||||
pageSizeControl: { maxPackets: 10 },
|
||||
|
||||
Reference in New Issue
Block a user