KTextAddons
7#include "voskspeechtotextplugin.h"
8#include "speechtotext_vosk_debug.h"
9#include "voskspeechtotextdevice.h"
12VoskSpeechToTextPlugin::VoskSpeechToTextPlugin(
QObject *parent)
13 : TextSpeechToText::SpeechToTextPlugin{parent}
14 , mDevice(new VoskSpeechToTextDevice(this))
16 connect(mDevice, &VoskSpeechToTextDevice::result,
this, &VoskSpeechToTextPlugin::speechToTextDone);
19VoskSpeechToTextPlugin::~VoskSpeechToTextPlugin() =
default;
21void VoskSpeechToTextPlugin::speechToText()
23 if (!mDevice->available()) {
24 qCWarning(SPEECHTOTEXT_VOSK_LOG) <<
"Vosk is not available";
30int VoskSpeechToTextPlugin::sampleRate()
const
35QIODevice *VoskSpeechToTextPlugin::audioDevice()
const
40bool VoskSpeechToTextPlugin::loadSettings()
43 VoskSpeechToTextDevice::VoskSpeechToTextDeviceInfo info;
44 info.sampleRate = sampleRate();
45 if (!mDevice->initialize(std::move(info))) {
46 qCWarning(SPEECHTOTEXT_VOSK_LOG) <<
"Impossible to initialize vosk plugin";
52void VoskSpeechToTextPlugin::clear()
57#include "moc_voskspeechtotextplugin.cpp"
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 11:53:03 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.