Discord Speech Recognition
    Preparing search index...

    Interface CommonSpeechOptions

    interface CommonSpeechOptions {
        group?: string;
        ignoreBots?: boolean;
        maximalVoiceMessageDuration?: number;
        minimalVoiceMessageDuration?: number;
        shouldProcessSpeech?: (user: User, connection: VoiceConnection) => boolean;
        silenceDuration?: number;
    }
    Index
    group?: string

    Group identifier, use it if you pass group to joinVoiceChannel https://discord.js.org/docs/packages/voice/main/JoinVoiceChannelOptions:Interface#group

    ignoreBots?: boolean

    Don't listen to other bots. Defaults to true

    maximalVoiceMessageDuration?: number

    Maximal length of a single voice message, in seconds. Longer speech is split into multiple voice messages.

    Defaults to 19, because Google Speech and wit.ai reject longer audio. Raise it if your speech recognition function can handle more.

    minimalVoiceMessageDuration?: number

    Minimal length of voice message that will be processed, in seconds. Defaults to 1

    shouldProcessSpeech?: (user: User, connection: VoiceConnection) => boolean

    Custom handler to decide whether to recognize speech. It is called when the user starts speaking: if it returns false, the audio isn't recorded or sent anywhere.

    Type Declaration

      • (user: User, connection: VoiceConnection): boolean
      • Parameters

        • user: User

          The user who spoke

        • connection: VoiceConnection

          Voice connection the user spoke on, connection.joinConfig has ids of the guild and the channel

        Returns boolean

    silenceDuration?: number

    How long the user has to be silent before the voice message ends, in milliseconds. Defaults to 300