9#include "config-vosk-plugin.h"
10#include "libvoskspeechtotext_export.h"
13#if HAVE_VOSK_API_SUPPORT
18class LIBVOSKSPEECHTOTEXT_EXPORT VoskSpeechToTextDevice :
public QIODevice
22 struct LIBVOSKSPEECHTOTEXT_EXPORT VoskSpeechToTextDeviceInfo {
29 explicit VoskSpeechToTextDevice(
QObject *parent =
nullptr);
30 ~VoskSpeechToTextDevice()
override;
33 [[nodiscard]]
bool initialize(VoskSpeechToTextDeviceInfo &&info);
35 [[nodiscard]]
bool available()
const;
37 [[nodiscard]]
bool isAsking()
const;
39 void setAsking(
bool asking);
42 void result(
const QString &str);
45 void falsePositiveWakeWord();
46 void wakeWordDetected();
49 qint64
readData(
char *data, qint64 maxlen)
override;
50 qint64
writeData(
const char *data, qint64 len)
override;
53 LIBVOSKSPEECHTOTEXT_NO_EXPORT
void parseText(
const char *json);
54 LIBVOSKSPEECHTOTEXT_NO_EXPORT
void parsePartial(
const char *json);
56 bool mIsAsking =
false;
57 bool mIsListiningBecauseOfWakeWord =
false;
58#if HAVE_VOSK_API_SUPPORT
59 VoskModel *mModel =
nullptr;
60 VoskRecognizer *mRecognizer =
nullptr;
63Q_DECLARE_TYPEINFO(VoskSpeechToTextDevice::VoskSpeechToTextDeviceInfo, Q_MOVABLE_TYPE);
64LIBVOSKSPEECHTOTEXT_EXPORT
QDebug operator<<(
QDebug d,
const VoskSpeechToTextDevice::VoskSpeechToTextDeviceInfo &t);
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
KCRASH_EXPORT void initialize()
virtual qint64 readData(char *data, qint64 maxSize)=0
virtual qint64 writeData(const char *data, qint64 maxSize)=0
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.