Interface VoiceSpeechService


public interface VoiceSpeechService
Service managing real-time speech recognition, keyword spotting, model management, and transcription stations in DreamVoice.
  • Method Details

    • transcribeRecording

      @NotNull @NotNull CompletableFuture<SpeechTranscriptionResult> transcribeRecording(@NotNull @NotNull VoiceRecording recording)
      Transcribes an existing VoiceRecording session asynchronously.
      Parameters:
      recording - the recording session
      Returns:
      future containing the structured transcription result
    • transcribePcm

      @NotNull @NotNull CompletableFuture<SpeechTranscriptionResult> transcribePcm(short @NotNull [] pcm, @Nullable @Nullable UUID speakerUuid)
      Transcribes raw 48kHz mono 16-bit PCM audio samples.
      Parameters:
      pcm - 16-bit 48kHz PCM samples
      speakerUuid - optional UUID of the speaker
      Returns:
      future containing the structured transcription result
    • downloadModel

      @NotNull @NotNull CompletableFuture<File> downloadModel(@NotNull @NotNull String langCode, @Nullable @Nullable Consumer<Double> progressConsumer)
      Downloads and extracts an official Vosk model by language code (e.g. "fr", "en", "de").
      Parameters:
      langCode - language code
      progressConsumer - progress consumer accepting values from 0.0 to 1.0
      Returns:
      future completed with the target extracted directory
    • getInstalledModels

      @NotNull @NotNull List<String> getInstalledModels()
      Retrieves the list of currently installed Vosk models in the models directory.
      Returns:
      list of model directory names
    • getCloudModels

      @NotNull @NotNull List<SpeechModelInfo> getCloudModels()
      Retrieves the catalogue of downloadable cloud models.
      Returns:
      list of supported models
    • getActiveModel

      @NotNull @NotNull String getActiveModel()
      Gets the active model identifier currently loaded or configured.
      Returns:
      active model id
    • setActiveModel

      boolean setActiveModel(@NotNull @NotNull String modelId)
      Sets and reloads the active model.
      Parameters:
      modelId - model identifier / folder name
      Returns:
      true if successfully loaded
    • isStationBlock

      boolean isStationBlock(@NotNull @NotNull org.bukkit.block.Block block)
      Checks whether a given block is configured as a transcription station.
      Parameters:
      block - target block
      Returns:
      true if allowed
    • startStationProcess

      void startStationProcess(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.block.Block stationBlock, @NotNull @NotNull org.bukkit.inventory.ItemStack cassetteItem)
      Starts the transcription process at a physical station block.
      Parameters:
      player - interacting player
      stationBlock - the station block
      cassetteItem - the cassette item in hand
    • createReportBook

      @NotNull @NotNull org.bukkit.inventory.ItemStack createReportBook(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull SpeechTranscriptionResult result)
      Creates a Minecraft WRITTEN_BOOK containing the formatted transcription report.
      Parameters:
      player - interacting or receiving player (for locale resolution)
      result - transcription result
      Returns:
      configured written book item
    • getRegisteredKeywords

      @NotNull @NotNull List<KeywordDefinition> getRegisteredKeywords()
      Retrieves the active list of registered keywords.
      Returns:
      unmodifiable list of keywords
    • reload

      void reload()
      Reloads configuration and keywords from disk.
    • isDebugEnabled

      boolean isDebugEnabled(@NotNull @NotNull UUID playerUuid)
      Checks if keyword detection debug notifications are enabled for the specified player.
      Parameters:
      playerUuid - player UUID
      Returns:
      true if debug notifications are enabled
    • setDebugEnabled

      void setDebugEnabled(@NotNull @NotNull UUID playerUuid, boolean enabled)
      Sets keyword detection debug notifications for the specified player.
      Parameters:
      playerUuid - player UUID
      enabled - whether debug notifications are enabled
    • toggleDebug

      boolean toggleDebug(@NotNull @NotNull UUID playerUuid)
      Toggles keyword detection debug notifications for the specified player.
      Parameters:
      playerUuid - player UUID
      Returns:
      new debug state
    • isGlobalDebugEnabled

      boolean isGlobalDebugEnabled()
      Checks if global console debug logging is enabled for keyword detection.
      Returns:
      true if global debug is enabled
    • setGlobalDebugEnabled

      void setGlobalDebugEnabled(boolean enabled)
      Sets global console debug logging for keyword detection.
      Parameters:
      enabled - whether global debug is enabled
    • toggleGlobalDebug

      boolean toggleGlobalDebug()
      Toggles global console debug logging for keyword detection.
      Returns:
      new global debug state