feat: enhance configuration management and add error handling

This commit is contained in:
MythEclipse
2026-05-13 16:57:07 +07:00
parent 673a06376c
commit 978c2c468d
14 changed files with 243 additions and 115 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ export function subscribeToAudioStream(
const audioStream = receiver.subscribe(userId, {
end: {
behavior: EndBehaviorType.AfterSilence,
duration: config.audioStreamSilenceDurationMs,
duration: config.AUDIO_STREAM_SILENCE_DURATION_MS,
},
});
+8 -3
View File
@@ -25,9 +25,14 @@ export class OpusDecoder {
options.createDecoder ??
(() =>
new prism.opus.Decoder({
frameSize: config.opusFrameSize,
channels: config.audioChannels as 1 | 2,
rate: config.audioSampleRate as 8000 | 12000 | 16000 | 24000 | 48000,
frameSize: config.OPUS_FRAME_SIZE,
channels: config.AUDIO_CHANNELS as 1 | 2,
rate: config.AUDIO_SAMPLE_RATE as
| 8000
| 12000
| 16000
| 24000
| 48000,
}));
}
+1 -1
View File
@@ -33,7 +33,7 @@ export async function collectUserMetadata(
avatarUrl:
user?.displayAvatarURL({
format: "png",
size: config.avatarSize as
size: config.AVATAR_SIZE as
| 16
| 32
| 64