[詳解]
9 #ifndef INCLUDED_AILIA_SPEECH
10 #define INCLUDED_AILIA_SPEECH
15 #include "ailia_tokenizer.h"
19 #if defined(_WIN64) || defined(_M_X64) || defined(__amd64__) || defined(__x86_64__) || defined(__APPLE__) || \
20 defined(__ANDROID__) || defined(ANDROID) || defined(__linux__) || defined(NN_NINTENDO_SDK)
23 #define AILIA_API __stdcall
43 #define AILIA_SPEECH_MODEL_TYPE_WHISPER_MULTILINGUAL_TINY (0)
54 #define AILIA_SPEECH_MODEL_TYPE_WHISPER_MULTILINGUAL_BASE (1)
65 #define AILIA_SPEECH_MODEL_TYPE_WHISPER_MULTILINGUAL_SMALL (2)
76 #define AILIA_SPEECH_MODEL_TYPE_WHISPER_MULTILINGUAL_MEDIUM (3)
87 #define AILIA_SPEECH_MODEL_TYPE_WHISPER_MULTILINGUAL_LARGE (4)
98 #define AILIA_SPEECH_MODEL_TYPE_WHISPER_MULTILINGUAL_LARGE_V3 (5)
113 #define AILIA_SPEECH_TASK_TRANSCRIBE (0)
124 #define AILIA_SPEECH_TASK_TRANSLATE (1)
139 #define AILIA_SPEECH_CONSTRAINT_CHARACTERS (0)
150 #define AILIA_SPEECH_CONSTRAINT_WORDS (1)
165 #define AILIA_SPEECH_FLAG_NONE (0)
176 #define AILIA_SPEECH_FLAG_LIVE (1)
191 #define AILIA_SPEECH_VAD_TYPE_SILERO (0)
206 #define AILIA_SPEECH_DICTIONARY_TYPE_REPLACE (0)
221 #define AILIA_SPEECH_POST_PROCESS_TYPE_T5 (0)
236 #define AILIA_SPEECH_POST_PROCESS_TYPE_FUGUMT_EN_JA (1)
251 #define AILIA_SPEECH_POST_PROCESS_TYPE_FUGUMT_JA_EN (2)
259 #if defined(_WIN32) && !defined(_WIN64)
260 #define AILIA_SPEECH_USER_API __stdcall
262 #define AILIA_SPEECH_USER_API
267 typedef int(
AILIA_SPEECH_USER_API*
AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_MEL_SPECTROGRAM)(
void*,
const void*, int, int, int, int, int, int, int, int, float, int, float, float, int, int, int);
313 #define AILIA_SPEECH_API_CALLBACK_VERSION (6)
387 #define AILIA_SPEECH_TEXT_VERSION (2)
582 int AILIA_API ailiaSpeechOpenPostProcessFileA(
struct AILIASpeech* net,
const char* encoder_path,
const char* decoder_path,
const char * source_path,
const char * target_path,
const char * prefix,
int post_process_type);
609 int AILIA_API ailiaSpeechOpenPostProcessFileW(
struct AILIASpeech* net,
const wchar_t* encoder_path,
const wchar_t* decoder_path,
const wchar_t * source_path,
const wchar_t * target_path,
const char * prefix,
int post_process_type);
633 ailiaSpeechPushInputData(
struct AILIASpeech* net,
const float* src,
unsigned int channels,
unsigned int samples,
unsigned int sampling_rate);
979 #define ailiaSpeechOpenModelFile ailiaSpeechOpenModelFileW
980 #define ailiaSpeechOpenVadFile ailiaSpeechOpenVadFileW
981 #define ailiaSpeechOpenDictionaryFile ailiaSpeechOpenDictionaryFileW
982 #define ailiaSpeechOpenPostProcessFile ailiaSpeechOpenPostProcessFileW
984 #define ailiaSpeechOpenModelFile ailiaSpeechOpenModelFileA
985 #define ailiaSpeechOpenVadFile ailiaSpeechOpenVadFileA
986 #define ailiaSpeechOpenDictionaryFile ailiaSpeechOpenDictionaryFileA
987 #define ailiaSpeechOpenPostProcessFile ailiaSpeechOpenPostProcessFileA
void AILIA_API ailiaSpeechDestroy(struct AILIASpeech *net)
ネットワークオブジェクトを破棄します。
int AILIA_API ailiaSpeechPushInputData(struct AILIASpeech *net, const float *src, unsigned int channels, unsigned int samples, unsigned int sampling_rate)
音声をキューに投入します。
AILIA_SPEECH_USER_API_AILIA_COPY_BLOB_DATA ailiaCopyBlobData
Definition: ailia_speech.h:347
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_MEL_SPECTROGRAM)(void *, const void *, int, int, int, int, int, int, int, int, float, int, float, float, int, int, int)
Definition: ailia_speech.h:267
AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_RESAMPLE_LEN ailiaAudioGetResampleLen
Definition: ailia_speech.h:320
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_OPEN_MODEL_FILE_W ailiaTokenizerOpenModelFileW
Definition: ailia_speech.h:323
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_INTERMEDIATE_CALLBACK)(void *handle, const char *text)
推論の途中の状況を通知します。
Definition: ailia_speech.h:370
int AILIA_API ailiaSpeechSetConstraint(struct AILIASpeech *net, const char *constraint, int type)
制約の設定を行います。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_UPDATE)(struct AILIANetwork *)
Definition: ailia_speech.h:292
AILIA_SPEECH_USER_API_AILIA_GET_BLOB_DATA ailiaGetBlobData
Definition: ailia_speech.h:342
const char * text
Definition: ailia_speech.h:390
int AILIA_API ailiaSpeechComplete(struct AILIASpeech *net, unsigned int *complete)
全てのデータの処理が完了したかどうかを判定します。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TOKEN_COUNT)(struct AILIATokenizer *, unsigned int *)
Definition: ailia_speech.h:276
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_CREATE)(struct AILIATokenizer **, int, int)
Definition: ailia_speech.h:272
int AILIA_API ailiaSpeechPostProcess(struct AILIASpeech *net)
後処理を行います。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_OPEN_WEIGHT_MEM)(struct AILIANetwork *, const void *, unsigned int)
Definition: ailia_speech.h:289
Definition: ailia_speech.h:316
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TEXT)(struct AILIATokenizer *, char *, unsigned int)
Definition: ailia_speech.h:280
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_SET_MEMORY_MODE)(struct AILIANetwork *, unsigned int)
Definition: ailia_speech.h:290
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TOKENS)(struct AILIATokenizer *, int *, unsigned int)
Definition: ailia_speech.h:277
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TEXT_LENGTH ailiaTokenizerGetTextLength
Definition: ailia_speech.h:328
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_SET_INPUT_BLOB_SHAPE)(struct AILIANetwork *, const AILIAShape *, unsigned int, unsigned int)
Definition: ailia_speech.h:297
const typedef char *AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_GET_ERROR_DETAIL(struct AILIANetwork *)
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_OPEN_WEIGHT_FILE_W)(struct AILIANetwork *, const wchar_t *)
Definition: ailia_speech.h:288
int AILIA_API ailiaSpeechSetLanguage(struct AILIASpeech *net, const char *language)
言語設定を行います。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_COPY_BLOB_DATA)(struct AILIANetwork *dst_net, unsigned int dst_blob_idx, struct AILIANetwork *src_net, unsigned int src_blob_idx)
Definition: ailia_speech.h:300
int AILIA_API ailiaSpeechSetPrompt(struct AILIASpeech *net, const char *prompt)
プロンプトの設定を行います。
AILIA_SPEECH_USER_API_AILIA_SET_INPUT_BLOB_DATA ailiaSetInputBlobData
Definition: ailia_speech.h:343
int AILIA_API ailiaSpeechOpenModelFileA(struct AILIASpeech *net, const char *encoder_path, const char *decoder_path, int model_type)
モデルを指定します。(MBSC)
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_DECODE)(struct AILIATokenizer *, const int *, unsigned int)
Definition: ailia_speech.h:278
int AILIA_API ailiaSpeechSetText(struct AILIASpeech *net, const AILIASpeechText *text, unsigned int version, unsigned int idx)
ポストプロセス対象のテキストを設定します。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TEXT_LENGTH)(struct AILIATokenizer *, unsigned int *)
Definition: ailia_speech.h:279
#define AILIA_SPEECH_USER_API
Definition: ailia_speech.h:262
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_OPEN_WEIGHT_FILE_A)(struct AILIANetwork *, const char *)
Definition: ailia_speech.h:287
const char * language
Definition: ailia_speech.h:394
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_ENCODE ailiaTokenizerEncode
Definition: ailia_speech.h:324
float time_stamp_begin
Definition: ailia_speech.h:391
int AILIA_API ailiaSpeechOpenDictionaryFileA(struct AILIASpeech *net, const char *dictionary_path, int dictionary_type)
誤り訂正辞書を指定します。(MBSC)
float confidence
Definition: ailia_speech.h:395
AILIA_SPEECH_USER_API_AILIA_AUDIO_RESAMPLE ailiaAudioResample
Definition: ailia_speech.h:319
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_DESTROY ailiaTokenizerDestroy
Definition: ailia_speech.h:330
AILIA_SPEECH_USER_API_AILIA_CREATE ailiaCreate
Definition: ailia_speech.h:333
AILIA_SPEECH_USER_API_AILIA_GET_ENVIRONMENT ailiaGetEnvironment
Definition: ailia_speech.h:348
AILIA_SPEECH_USER_API_AILIA_GET_BLOB_INDEX_BY_OUTPUT_INDEX ailiaGetBlobIndexByOutputIndex
Definition: ailia_speech.h:341
void(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_DESTROY)(struct AILIANetwork *)
Definition: ailia_speech.h:291
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_UTF8_TO_UTF32 ailiaTokenizerUtf8ToUtf32
Definition: ailia_speech.h:331
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_GET_BLOB_INDEX_BY_OUTPUT_INDEX)(struct AILIANetwork *, unsigned int *, unsigned int)
Definition: ailia_speech.h:294
int AILIA_API ailiaSpeechCreate(struct AILIASpeech **net, int env_id, int num_thread, int memory_mode, int task, int flags, AILIASpeechApiCallback callback, int version)
ネットワークオブジェクトを作成します。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_FRAME_LEN)(int *, int, int, int, int)
Definition: ailia_speech.h:266
int AILIA_API ailiaSpeechSetIntermediateCallback(struct AILIASpeech *net, AILIA_SPEECH_USER_API_INTERMEDIATE_CALLBACK callback, void *handle)
認識の途中結果を取得するコールバックを設定します。
AILIA_SPEECH_USER_API_AILIA_OPEN_WEIGHT_FILE_W ailiaOpenWeightFileW
Definition: ailia_speech.h:335
int AILIA_API ailiaSpeechOpenVadFileW(struct AILIASpeech *net, const wchar_t *vad_path, int vad_type)
無音検知に適用するVADモデルを指定します。(UTF16)
AILIA_SPEECH_USER_API_AILIA_GET_ERROR_DETAIL ailiaGetErrorDetail
Definition: ailia_speech.h:346
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_UTF32_TO_UTF8 ailiaTokenizerUtf32ToUtf8
Definition: ailia_speech.h:332
int AILIA_API ailiaSpeechSetSilentThreshold(struct AILIASpeech *net, float silent_threshold, float speech_sec, float no_speech_sec)
無音判定の閾値を設定します。
AILIA_SPEECH_USER_API_AILIA_GET_BLOB_INDEX_BY_INPUT_INDEX ailiaGetBlobIndexByInputIndex
Definition: ailia_speech.h:340
int AILIA_API ailiaSpeechTranscribe(struct AILIASpeech *net)
音声認識を行います。
struct _AILIASpeechApiCallback AILIASpeechApiCallback
AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_MEL_SPECTROGRAM ailiaAudioGetMelSpectrogram
Definition: ailia_speech.h:318
int AILIA_API ailiaSpeechOpenPostProcessFileW(struct AILIASpeech *net, const wchar_t *encoder_path, const wchar_t *decoder_path, const wchar_t *source_path, const wchar_t *target_path, const char *prefix, int post_process_type)
後処理知に適用するAIモデルを指定します。(UTF16)
int AILIA_API ailiaSpeechOpenModelFileW(struct AILIASpeech *net, const wchar_t *encoder_path, const wchar_t *decoder_path, int model_type)
モデルを指定します。(UTF16)
int AILIA_API ailiaSpeechResetTranscribeState(struct AILIASpeech *net)
ネットワークオブジェクトの内部状態を初期化します。
int AILIA_API ailiaSpeechBuffered(struct AILIASpeech *net, unsigned int *buffered)
音声認識を行うために十分なデータが存在するかどうかを判定します。
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TOKENS ailiaTokenizerGetTokens
Definition: ailia_speech.h:326
AILIA_SPEECH_USER_API_AILIA_GET_BLOB_SHAPE ailiaGetBlobShape
Definition: ailia_speech.h:345
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TEXT ailiaTokenizerGetText
Definition: ailia_speech.h:329
Definition: ailia_speech.h:389
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_RESAMPLE_LEN)(int *, int, int, int)
Definition: ailia_speech.h:269
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_UTF32_TO_UTF8)(char *, unsigned int *, unsigned int)
Definition: ailia_speech.h:283
AILIA_SPEECH_USER_API_AILIA_SET_INPUT_BLOB_SHAPE ailiaSetInputBlobShape
Definition: ailia_speech.h:344
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_GET_BLOB_SHAPE)(struct AILIANetwork *, AILIAShape *, unsigned int, unsigned int)
Definition: ailia_speech.h:298
struct _AILIASpeechText AILIASpeechText
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_OPEN_MODEL_FILE_A ailiaTokenizerOpenModelFileA
Definition: ailia_speech.h:322
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_SET_INPUT_BLOB_DATA)(struct AILIANetwork *, const void *, unsigned int, unsigned int)
Definition: ailia_speech.h:296
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_ENCODE)(struct AILIATokenizer *, const char *)
Definition: ailia_speech.h:275
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_CREATE)(struct AILIANetwork **, int, int)
Definition: ailia_speech.h:286
AILIA_SPEECH_USER_API_AILIA_DESTROY ailiaDestroy
Definition: ailia_speech.h:338
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_OPEN_MODEL_FILE_A)(struct AILIATokenizer *, const char *)
Definition: ailia_speech.h:273
int AILIA_API ailiaSpeechGetTextCount(struct AILIASpeech *net, unsigned int *count)
認識したテキストの数を取得します。
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_OPEN_MODEL_FILE_W)(struct AILIATokenizer *, const wchar_t *)
Definition: ailia_speech.h:274
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_UTF8_TO_UTF32)(unsigned int *, unsigned int *, const char *, unsigned int)
Definition: ailia_speech.h:282
void(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_TOKENIZER_DESTROY)(struct AILIATokenizer *)
Definition: ailia_speech.h:281
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_CREATE ailiaTokenizerCreate
Definition: ailia_speech.h:321
AILIA_SPEECH_USER_API_AILIA_OPEN_WEIGHT_MEM ailiaOpenWeightMem
Definition: ailia_speech.h:336
int AILIA_API ailiaSpeechOpenDictionaryFileW(struct AILIASpeech *net, const wchar_t *dictionary_path, int dictionary_type)
誤り訂正辞書を指定します。(UTF16)
AILIA_SPEECH_USER_API_AILIA_AUDIO_GET_FRAME_LEN ailiaAudioGetFrameLen
Definition: ailia_speech.h:317
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_GET_BLOB_DATA)(struct AILIANetwork *, void *, unsigned int, unsigned int)
Definition: ailia_speech.h:295
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_GET_BLOB_INDEX_BY_INPUT_INDEX)(struct AILIANetwork *, unsigned int *, unsigned int)
Definition: ailia_speech.h:293
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_GET_ENVIRONMENT)(AILIAEnvironment **env, unsigned int env_idx, unsigned int version)
Definition: ailia_speech.h:301
const char *AILIA_API ailiaSpeechGetErrorDetail(struct AILIASpeech *net)
エラーの詳細を返します
AILIA_SPEECH_USER_API_AILIA_UPDATE ailiaUpdate
Definition: ailia_speech.h:339
#define AILIA_API
Definition: ailia_speech.h:23
int AILIA_API ailiaSpeechOpenVadFileA(struct AILIASpeech *net, const char *vad_path, int vad_type)
無音検知に適用するVADモデルを指定します。(MBSC)
int AILIA_API ailiaSpeechGetText(struct AILIASpeech *net, AILIASpeechText *text, unsigned int version, unsigned int idx)
認識したテキストを取得します。
int AILIA_API ailiaSpeechOpenPostProcessFileA(struct AILIASpeech *net, const char *encoder_path, const char *decoder_path, const char *source_path, const char *target_path, const char *prefix, int post_process_type)
後処理知に適用するAIモデルを指定します。(MBSC)
unsigned int person_id
Definition: ailia_speech.h:393
int AILIA_API ailiaSpeechFinalizeInputData(struct AILIASpeech *net)
音声のキューへの投入を終了します。
AILIA_SPEECH_USER_API_AILIA_SET_MEMORY_MODE ailiaSetMemoryMode
Definition: ailia_speech.h:337
AILIA_SPEECH_USER_API_AILIA_OPEN_WEIGHT_FILE_A ailiaOpenWeightFileA
Definition: ailia_speech.h:334
float time_stamp_end
Definition: ailia_speech.h:392
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_GET_TOKEN_COUNT ailiaTokenizerGetTokenCount
Definition: ailia_speech.h:325
AILIA_SPEECH_USER_API_AILIA_TOKENIZER_DECODE ailiaTokenizerDecode
Definition: ailia_speech.h:327
int(AILIA_SPEECH_USER_API * AILIA_SPEECH_USER_API_AILIA_AUDIO_RESAMPLE)(void *, const void *, int, int, int, int)
Definition: ailia_speech.h:268