Interface VoiceSpeechService
public interface VoiceSpeechService
Service managing real-time speech recognition, keyword spotting, model management,
and transcription stations in DreamVoice.
-
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.inventory.ItemStackcreateReportBook(@NotNull org.bukkit.entity.Player player, @NotNull SpeechTranscriptionResult result) Creates a MinecraftWRITTEN_BOOKcontaining the formatted transcription report.@NotNull CompletableFuture<File> downloadModel(@NotNull String langCode, @Nullable Consumer<Double> progressConsumer) Downloads and extracts an official Vosk model by language code (e.g.@NotNull StringGets the active model identifier currently loaded or configured.@NotNull List<SpeechModelInfo> Retrieves the catalogue of downloadable cloud models.Retrieves the list of currently installed Vosk models in the models directory.@NotNull List<KeywordDefinition> Retrieves the active list of registered keywords.booleanisDebugEnabled(@NotNull UUID playerUuid) Checks if keyword detection debug notifications are enabled for the specified player.booleanChecks if global console debug logging is enabled for keyword detection.booleanisStationBlock(@NotNull org.bukkit.block.Block block) Checks whether a given block is configured as a transcription station.voidreload()Reloads configuration and keywords from disk.booleansetActiveModel(@NotNull String modelId) Sets and reloads the active model.voidsetDebugEnabled(@NotNull UUID playerUuid, boolean enabled) Sets keyword detection debug notifications for the specified player.voidsetGlobalDebugEnabled(boolean enabled) Sets global console debug logging for keyword detection.voidstartStationProcess(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.block.Block stationBlock, @NotNull org.bukkit.inventory.ItemStack cassetteItem) Starts the transcription process at a physical station block.booleantoggleDebug(@NotNull UUID playerUuid) Toggles keyword detection debug notifications for the specified player.booleanToggles global console debug logging for keyword detection.@NotNull CompletableFuture<SpeechTranscriptionResult> transcribePcm(short @NotNull [] pcm, @Nullable UUID speakerUuid) Transcribes raw 48kHz mono 16-bit PCM audio samples.@NotNull CompletableFuture<SpeechTranscriptionResult> transcribeRecording(@NotNull VoiceRecording recording) Transcribes an existingVoiceRecordingsession asynchronously.
-
Method Details
-
transcribeRecording
@NotNull @NotNull CompletableFuture<SpeechTranscriptionResult> transcribeRecording(@NotNull @NotNull VoiceRecording recording) Transcribes an existingVoiceRecordingsession 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 samplesspeakerUuid- 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 codeprogressConsumer- progress consumer accepting values from 0.0 to 1.0- Returns:
- future completed with the target extracted directory
-
getInstalledModels
-
getCloudModels
Retrieves the catalogue of downloadable cloud models.- Returns:
- list of supported models
-
getActiveModel
Gets the active model identifier currently loaded or configured.- Returns:
- active model id
-
setActiveModel
Sets and reloads the active model.- Parameters:
modelId- model identifier / folder name- Returns:
trueif 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:
trueif 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 playerstationBlock- the station blockcassetteItem- 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 MinecraftWRITTEN_BOOKcontaining the formatted transcription report.- Parameters:
player- interacting or receiving player (for locale resolution)result- transcription result- Returns:
- configured written book item
-
getRegisteredKeywords
Retrieves the active list of registered keywords.- Returns:
- unmodifiable list of keywords
-
reload
void reload()Reloads configuration and keywords from disk. -
isDebugEnabled
Checks if keyword detection debug notifications are enabled for the specified player.- Parameters:
playerUuid- player UUID- Returns:
trueif debug notifications are enabled
-
setDebugEnabled
Sets keyword detection debug notifications for the specified player.- Parameters:
playerUuid- player UUIDenabled- whether debug notifications are enabled
-
toggleDebug
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:
trueif 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
-