feat: enhance configuration management and add error handling
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user