
Spokestack을 사용하여 음성을 추가하기 위해 기본 플러그인을 반응합니다. 여기에는 음성 인식, Wakeword 및 자연 언어 이해뿐만 아니라 스포크 스택 목소리를 사용하여 음성에 대한 텍스트를 합성하는 것이 포함됩니다.
NPM 사용 :
npm install --save react-native-spokestack또는 원사 사용 :
yarn add react-native-spokestack그런 다음 각 플랫폼에 대한 지침을 따르십시오.
먼저 Xcode를 열고 프로젝트 -> 정보로 이동하여 iOS 배포 대상을 13.0 이상으로 설정하십시오.
또한 대상 -> 일반 -> 배포 정보에 따라 배포를 13.0으로 설정하십시오.
Flipper가 React Native를 위해 도입되었을 때 일부 라이브러리 검색 경로는 Swift로 설정되었습니다. React Native Projects의 기본 검색 경로에는 오랜 문제가있었습니다. SWIFT 5.0의 검색 경로가 추가 되었기 때문에 다른 React 기본 라이브러리가 SWIFT 5.2 이상으로 만 사용할 수있는 API를 사용하지 못하게되었습니다. Real-Native-Spokestack의 종속성 인 Spokestack-IOS는 이러한 API를 사용하며 Xcode는 빌드되지 않습니다.
다행히이 수정은 상당히 간단합니다. 목표 -> 설정 구축 및 "라이브러리 검색 경로"를 검색하십시오.
목록에서 ""$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"" 제거하십시오.
pod install 실행하기 전에 다음 편집을하십시오.
React-Native-Spokestack은 iOS 13+에서만 사용할 수있는 비교적 새로운 API를 사용합니다. Podfile 상단에서 배포 대상을 iOS 13으로 설정하십시오.
platform :ios , '13.0' 또한 use_frameworks! Swift로 작성된 종속성을 지원하기 위해 Podfile에서.
target 'SpokestackExample' do
use_frameworks!
#... 지금은 use_frameworks! 플리퍼와 함께 작동하지 않으므로 플리퍼도 비활성화해야합니다. 포드 파일에서 플리퍼 관련 라인을 제거하십시오. React Native 0.63.2+에서는 다음과 같습니다.
# X Remove or comment out these lines X
# use_flipper!
# post_install do |installer|
# flipper_post_install(installer)
# end
# XX React Native 0.64.0은 use_frameworks! 그들의 podfiles에서.
이 버그에 대한 자세한 내용은 Facebook/React-Native#31149를 참조하십시오.
이 문제를 해결하려면 Podfile에 다음을 추가하십시오.
# Moves 'Generate Specs' build_phase to be first for FBReactNativeSpec
post_install do | installer |
installer . pods_project . targets . each do | target |
if ( target . name &. eql? ( 'FBReactNativeSpec' ) )
target . build_phases . each do | build_phase |
if ( build_phase . respond_to? ( :name ) && build_phase . name . eql? ( '[CP-User] Generate Specs' ) )
target . build_phases . move ( build_phase , 0 )
end
end
end
end
end 충돌이 없도록 기존의 podfile.lock 및 pods 폴더를 제거한 다음 포드를 설치하십시오.
$ npx pod-install다음을 info.plist에 추가하여 권한을 활성화하십시오.
< key >NSMicrophoneUsageDescription</ key >
< string >This app uses the microphone to hear voice commands</ string >
< key >NSSpeechRecognitionUsageDescription</ key >
< string >This app uses speech recognition to process voice commands</ string > Flipper는 use_frameworks! , 우리는 플리퍼를 비활성화해야합니다. 우리는 이미 위의 포드에서 플리퍼 종속성을 제거했지만 Flipper를 가져 오는 AppDelegate.m에는 코드가 남아 있습니다. 이것을 고치는 두 가지 방법이 있습니다.
-DFB_SONARKIT_ENABLED=1 제거하십시오.이 예제 앱에서는 옵션 1을 수행하고 향후 작동 할 경우 플리퍼 코드를 남겨두고 다시 추가 할 수 있습니다.
# import < AVFoundation/AVFoundation.h > 오디오 세션 카테고리를 설정하십시오. 작동하는 몇 가지 구성이 있습니다.
다음은 대부분의 사용 사례에 맞는 제안입니다.
- ( BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *)launchOptions
{
AVAudioSession *session = [AVAudioSession sharedInstance ];
[session setCategory: AVAudioSessionCategoryPlayAndRecord
mode: AVAudioSessionModeDefault
options: AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowAirPlay | AVAudioSessionCategoryOptionAllowBluetoothA2DP | AVAudioSessionCategoryOptionAllowBluetooth
error: nil ];
[session setActive: YES error: nil ];
// ... 이 예제 사용은 시스템 제공 ASR ( AndroidSpeechRecognizer 및 AppleSpeechRecognizer )을 사용합니다. 그러나 AndroidSpeechRecognizer 장치의 100%에서 사용할 수 없습니다. 앱이 스피치 인식이 내장되지 않은 장치를 지원하는 경우 profile 사용하여 스포크 profile 프로필로 프로파일을 설정하여 Spokestack ASR을 사용하십시오.
자세한 내용은 ASR 문서를 참조하십시오.
// ...
ext {
// Set the minimum SDK to 24.
// React Native 0.64+ sets version 21.
// If you prefer to leave the minimum SDK at 21,
// another option is to set this to 21, but
// also set android.enableDexingArtifactTransform=false
// in your top-level gradle.properties.
// See https://github.com/google/ExoPlayer/issues/6801#issuecomment-574089568
minSdkVersion = 24
// ...
dependencies {
// Minimium gradle is 3.0.1+
// The latest React Native already has this
classpath( " com.android.tools.build:gradle:4.2.1 " ) AndroidManifest.xml 에 필요한 권한을 추가하십시오. 첫 번째 허가는 종종 이미 있습니다. 두 번째는 마이크를 사용하는 데 필요합니다.
<!-- For TTS -->
< uses-permission android : name = " android.permission.INTERNET " />
<!-- For wakeword and ASR -->
< uses-permission android : name = " android.permission.RECORD_AUDIO " />
<!-- For ensuring no downloads happen over cellular, unless forced -->
< uses-permission android : name = " android.permission.ACCESS_NETWORK_STATE " /> record_audio 권한은 런타임에 요청할뿐만 아니라 AndroidManifest.xml 에 나열되어 있어야한다는 점에서 특별합니다. 이것을 처리하는 몇 가지 방법이 있습니다 (React-Native-Spokestack은 귀하를 위해이를 수행하지 않습니다).
iOS는 필요한 모든 권한에 대해 권한 대화 상자를 자동으로 가져 오지만 Android에서 수동으로 수행해야합니다.
React Native는 이미이를위한 모듈을 제공합니다. 자세한 내용은 React Native의 권한 산드로이드를 참조하십시오.
Spokestack을 사용하기 시작하거나 ASR, NLU 및 TTS에서 심층적 인 자습서를 확인하십시오. 또한 일반적인 문제에 대한 빠른 해결책을 얻으려면 요리 책을 살펴보십시오.
example/ 폴더 에이 리도록 작업 예제 앱이 포함되어 있습니다.
import Spokestack from 'react-native-spokestack'
import { View , Button , Text } from 'react-native'
function App ( ) {
const [ listening , setListening ] = useState ( false )
const onActivate = ( ) => setListening ( true )
const onDeactivate = ( ) => setListening ( false )
const onRecognize = ( { transcript } ) => console . log ( transcript )
useEffect ( ( ) => {
Spokestack . addEventListener ( 'activate' , onActivate )
Spokestack . addEventListener ( 'deactivate' , onDeactivate )
Spokestack . addEventListener ( 'recognize' , onRecognize )
Spokestack . initialize (
process . env . SPOKESTACK_CLIENT_ID ,
process . env . SPOKESTACK_CLIENT_SECRET
)
// This example starts the Spokestack pipeline immediately,
// but it could be delayed until after onboarding or other
// conditions have been met.
. then ( Spokestack . start )
return ( ) => {
Spokestack . removeAllListeners ( )
}
} , [ ] )
return (
< View >
< Button onClick = { ( ) => Spokestack . activate ( ) } title = "Listen" />
< Text > { listening ? 'Listening...' : 'Idle' } </ Text >
</ View >
)
} 앱에 로컬로 모델 파일을 포함하려면 (CDN에서 다운로드하는 대신) 필요한 내선을 추가하여 파일을 Babel에 포함시킬 수 있도록해야합니다. 이렇게하려면 metro.config.js 편집하십시오.
const defaults = require ( 'metro-config/src/defaults/defaults' )
module . exports = {
resolver : {
assetExts : defaults . assetExts . concat ( [ 'tflite' , 'txt' , 'sjson' ] )
}
}그런 다음 소스 개체를 사용하여 모델 파일을 포함시킵니다.
Spokestack . initialize ( clientId , clientSecret , {
wakeword : {
filter : require ( './filter.tflite' ) ,
detect : require ( './detect.tflite' ) ,
encode : require ( './encode.tflite' )
} ,
nlu : {
model : require ( './nlu.tflite' ) ,
vocab : require ( './vocab.txt' ) ,
// Be sure not to use "json" here.
// We use a different extension (.sjson) so that the file is not
// immediately parsed as json and instead
// passes a require source object to Spokestack.
// The special extension is only necessary for local files.
metadata : require ( './metadata.sjson' )
}
} ) 이것은 필요하지 않습니다. 원격 URL을 동일한 구성 옵션으로 전달하면 처음 호출 initialize 때 파일이 다운로드 및 캐시됩니다.
리포지토리 및 개발 워크 플로에 기여하는 방법을 배우려면 기고 가이드를 참조하십시오.
▸ 초기화 ( clientId , clientSecret , config? ) : Promise void
음성 파이프 라인을 초기화하십시오. 다른 모든 방법에 필요합니다.
처음 2 개의 Args는 https://spokestack.io에서 무료로 제공되는 Spokestack 자격 증명입니다. 앱에서 하드 코딩을 피하십시오. 코드에 환경 변수를 포함시키는 몇 가지 방법이 있습니다.
Process.env 사용 : https://babeljs.io/docs/en/babel-plugin-transforminline-variables/
git에 의해 무시되는 로컬 .env 파일 : https://github.com/goatandsheep/react-native-dotenv https://github.com/luggit/react-native-config
사용 가능한 모든 옵션은 SpokestackConfig를 참조하십시오.
example
import Spokestack from 'react-native-spokestack'
// ...
await Spokestack . initialize ( process . env . CLIENT_ID , process . env . CLIENT_SECRET , {
pipeline : {
profile : Spokestack . PipelineProfile . PTT_NATIVE_ASR
}
} ) | 이름 | 유형 |
|---|---|
clientId | string |
clientSecret | string |
config? | [SpokestackConfig](#SpokestackConfig) |
Promise void
index.ts : 64
▸ Destrove () : Promise void
음성 파이프 라인을 파괴하고 모든 청취자를 제거하며 모든 리소스를 해방시킵니다. 파이프 라인을 다시 시작하기 전에 호출 할 수 있습니다. 이것을 호출하기에 좋은 곳은 componentWillUnmount 에 있습니다.
example
componentWillUnmount ( ) {
Spokestack . destroy ( )
} Promise void
index.ts : 81
start () : Promise void
음성 파이프 라인을 시작하십시오. 음성 파이프 라인은 deactivate 상태에서 시작됩니다.
example
import Spokestack from 'react-native-spokestack`
// ...
Spokestack . initialize ( process . env . CLIENT_ID , process . env . CLIENT_SECRET )
. then ( Spokestack . start ) Promise void
index.ts : 96
▸ stop () : Promise void
음성 파이프 라인을 중지하십시오. 이것은 효과적으로 ASR, Vad 및 Wakeword를 중지합니다.
example
import Spokestack from 'react-native-spokestack`
// ...
await Spokestack . stop ( ) Promise void
index.ts : 110
▸ activate () : Promise void
음성 파이프 라인을 수동으로 활성화합니다. PTT 프로파일을 사용할 때 필요합니다. VAD 프로파일은이 방법을 호출 할 필요없이 ASR을 활성화 할 수 있습니다.
example
import Spokestack from 'react-native-spokestack`
// ...
< Button title = "Listen" onClick = { ( ) => Spokestack . activate ( ) } /> Promise void
index.ts : 126
deactivate () : Promise void
음성 파이프 라인을 비활성화하십시오. 프로필에 Wakeword가 포함 된 경우 파이프 라인은 Wakeword를 듣습니다. VAD가 활성화되면 파이프 라인은 activeate ()를 호출하지 않고 재 활성화 될 수 있습니다.
example
import Spokestack from 'react-native-spokestack`
// ...
< Button title = "Stop listening" onClick = { ( ) => Spokestack . deactivate ( ) } /> Promise void
index.ts : 142
▸ 합성 ( input , format? , voice? ) : Promise string
일부 텍스트를 음성으로 합성하십시오 Promise<string> 은 문자열이 재생 가능한 MPEG의 URL입니다.
현재 무료 음성이 있습니다 ( "데모 남성"). 스포크 스택 메이커 계정을 사용하여 사용자 정의 음성을 만든 경우 음성을 변경할 수 있습니다. https://spokestack.io/pricing#maker를 참조하십시오.
example
const url = await Spokestack . synthesize ( 'Hello world' )
play ( url ) | 이름 | 유형 |
|---|---|
input | string |
format? | [TTSFormat](#TTSFormat) |
voice? | string |
Promise < string >
index.ts : 158
speak ( input , format? , voice? ) : Promise void
일부 텍스트를 음성으로 합성 한 다음 기본 오디오 시스템을 통해 즉시 오디오를 재생합니다. 오디오 세션 처리는 매우 복잡해질 수 있으며 오디오에 중점을 둔 RN 라이브러리를 사용하여 매우 간단한 재생 이상의 것을 사용하는 것이 좋습니다.
현재 무료 음성이 있습니다 ( "데모 남성").
example
await Spokestack . speak ( 'Hello world' ) | 이름 | 유형 |
|---|---|
input | string |
format? | [TTSFormat](#TTSFormat) |
voice? | string |
Promise void
index.ts : 174
▸ 분류 ( utterance ) : Promise SpokestackNLUResult
Spokestack.initialize ()로 전달 된 의도/슬롯 자연 언어 이해 모델을 사용하여 발화를 분류하십시오. 자세한 내용은 https://www.spokestack.io/docs/concepts/nlu를 참조하십시오.
example
const result = await Spokestack . classify ( 'hello' )
// Here's what the result might look like,
// depending on the NLU model
console . log ( result . intent ) // launch | 이름 | 유형 |
|---|---|
utterance | string |
Promise SpokestackNLUResult
index.ts : 190
▸ isinitialized () : Promise boolean
스포크 스택이 초기화되었는지 여부를 반환합니다
example
console . log ( `isInitialized: ${ await Spokestack . isInitialized ( ) } ` ) Promise < boolean >
index.ts : 199
▸ isstarted () : Promise boolean
음성 파이프 라인이 시작되었는지 여부를 반환합니다
example
console . log ( `isStarted: ${ await Spokestack . isStarted ( ) } ` ) Promise < boolean >
index.ts : 208
▸ isActivated () : Promise boolean
음성 파이프 라인이 현재 활성화되어 있는지 여부를 반환합니다
example
console . log ( `isActivated: ${ await Spokestack . isActivated ( ) } ` ) Promise < boolean >
index.ts : 217
• 자신감 : number
NLU 모델의 인식 의도에 대한 신뢰를 나타내는 0에서 1의 숫자는 절대적인 신뢰를 나타냅니다.
types.ts : 115
• 의도 : string
NLU 모델에서 제공 한 경기에 기반한 의도
types.ts : 113
• 슬롯 : SpokestackNLUSlots
NLU 모델에서 제공하는 의도와 관련된 데이터
types.ts : 117
▪ [키 : string ] : SpokestackNLUSlot
• RawValue : string
사용자 발언에서 인식 된 슬롯의 원래 문자열 값
types.ts : 104
• 유형 : string
모델 메타 데이터에 정의 된 슬롯 유형
type.ts : 100
• 가치 : any
사용자 발언에서 인식 된 슬롯의 구문 분석 (유형) 값
types.ts : 102
▸ addeventListener ( eventType , listener , context? ) : EmitterSubscription
기본 라이브러리가 방출 한 모든 이벤트에 바인딩 사용 가능한 모든 이벤트 목록에 대한 이벤트를 참조하십시오.
example
useEffect ( ( ) => {
const listener = Spokestack . addEventListener ( 'recognize' , onRecognize )
// Unsubsribe by calling remove when components are unmounted
return ( ) => {
listener . remove ( )
}
} , [ ] ) | 이름 | 유형 | 설명 |
|---|---|---|
eventType | string | 리스너를 등록하는 이벤트 이름 |
listener | ( event : any ) => void | 리스너 기능 |
context? | Object | 청취자의 맥락 |
EmitterSubscription
index.ts : 237
▸ removeEventListener ( eventType , listener ) : void
이벤트 리스너를 제거하십시오
example
Spokestack . removeEventListener ( 'recognize' , onRecognize ) | 이름 | 유형 | 설명 |
|---|---|---|
eventType | string | 방출 할 이벤트의 이름 |
listener | (... args : any []) => any | 지정된 이벤트가 방출 될 때 호출 할 수 있습니다 |
void
index.ts : 253
▸ removealllisteners () : void
기존 청취자를 제거하십시오
example
Spokestack . removeAllListeners ( ) void
index.ts : 265
Spokestack TTS를 사용할 때 세 가지 형식이 지원됩니다. 원시 텍스트, SSML 및 스피치 마크 다운. Speech Down에 익숙하지 않은 경우 https://www.speechmarkdown.org/을 참조하십시오. SSML 또는 Speech Markdown을 사용할 때 IPA가 예상됩니다.
• SpeechMarkdown = 2
types.ts : 73
• SSML = 1
types.ts : 72
• 텍스트 = 0
types.ts : 71
addEventListener() , removeEventListener() 및 removeAllListeners() 사용하여 이벤트 핸들러를 추가하고 제거하십시오. 모든 이벤트는 iOS 및 Android에서 사용할 수 있습니다.
| 이름 | 데이터 | 설명 |
|---|---|---|
| 인정하다 | { transcript: string } | 음성 인식이 성공적으로 완료 될 때마다 발사되었습니다. |
| partial_recognize | { transcript: string } | 음성 인식 중에 성적표가 변경 될 때마다 발사됩니다. |
| 시작 | null | 음성 파이프 라인이 시작될 때 해고되었습니다 (Wakeword를 듣기 시작하거나 VAD가 시작됩니다). |
| 멈추다 | null | 음성 파이프 라인이 멈출 때 발사되었습니다. |
| 활성화 | null | 음성 파이프 라인이 VAD, Wakeword를 통해 또는 .activate() 호출 할 때 활성화 될 때 발사되었습니다. |
| 비활성화 | null | 음성 파이프 라인이 비활성화 될 때 발사되었습니다. |
| 놀다 | { playing: boolean } | TTS 재생이 시작되고 멈출 때 발사되었습니다. speak() 함수를 참조하십시오. |
| 시간 초과 | null | 인식 부족으로 인해 활성 파이프 라인이 시간이 흐르면 발사되었습니다. |
| 추적하다 | { message: string } | 추적 메시지를 위해 해고되었습니다. Verbosity는 traceLevel 옵션에 의해 결정됩니다. |
| 오류 | { error: string } | Spokestack에 오류가 발생하면 해고되었습니다. |
오류 이벤트가 트리거되면 기존 약속이 거부됩니다.
이들은 Spokestack.initialize(_, _, spokestackConfig) 로 전달할 수있는 구성 옵션입니다. SpokestackConfig의 옵션이 필요하지 않습니다.
SPOKESTACKCONFIG에는 다음과 같은 구조가 있습니다.
interface SpokestackConfig {
/**
* This option is only used when remote URLs are passed to fields such as `wakeword.filter`.
*
* Set this to true to allow downloading models over cellular.
* Note that `Spokestack.initialize()` will still reject the promise if
* models need to be downloaded but there is no network at all.
*
* Ideally, the app will include network handling itself and
* inform the user about file downloads.
*
* Default: false
*/
allowCellularDownloads ?: boolean
/**
* Wakeword, Keyword, and NLU model files are cached internally.
* Set this to true whenever a model is changed
* during development to refresh the internal model cache.
*
* This affects models passed with `require()` as well
* as models downloaded from remote URLs.
*
* Default: true in dev mode, false otherwise
*
* **Important:** By default, apps in production will
* cache models to avoid downloading them every time
* the app is launched. The side-effect of this optimization
* is that if models change on the CDN, apps will
* not pick up those changes–unless the app were reinstalled.
* We think this is a fair trade-off, but set this to `true`
* if you prefer to download the models every time the app
* is launched.
*/
refreshModels ?: boolean
/**
* This controls the log level for the underlying native
* iOS and Android libraries.
* Also add a `"trace"` event listener to get trace events.
* See the TraceLevel enum for values.
*/
traceLevel ?: TraceLevel
/**
* Most of these options are advanced aside from "profile"
*/
pipeline ?: PipelineConfig
/** Only needed if using Spokestack.classify */
nlu ?: NLUConfig
/**
* Only required for wakeword
* Most options are advanced aside from
* filter, encode, and decode for specifying config files.
*/
wakeword ?: WakewordConfig
/**
* Only required for the keyword recognizer
* Most options are advanced aside from
* filter, encode, decode, metadata, and classes.
*/
keyword ?: KeywordConfig
} 더 낮은 숫자를 표시하기 위해 얼마나 많은 로깅이 더 많은 로그를 의미합니다.
• 디버그 = 10
types.ts : 58
• 정보 = 30
type.ts : 60
• 없음 = 100
types.ts : 61
• perf = 20
types.ts : 59
파이프 라인 프로파일 필요에 따라 음성 파이프 라인을 설정했습니다.
• ptt_native_asr = 2
Speech Pipeline이 활성화 될 때 Apple/Android 자동 음성 인식이 켜져 있습니다. Wakeword를 사용하지 않을 때는 더 일반적인 프로필 일 수 있습니다.
types.ts : 24
• PTT_SPOKESTACK_ASR = 5
Spokestack 자동 음성 인식은 음성 파이프 라인이 활성화 될 때 켜져 있습니다. Wakeword를 사용하지 않을 때는 더 일반적인 프로파일이지만 Spokestack ASR이 선호됩니다.
types.ts : 42
• tflite_wakeword_keyword = 6
VAD에 민감한 tflite 웨이크 워드는 tflite 키워드 인식기를 활성화합니다
types.ts : 46
• tflite_wakeword_native_asr = 0
Wakeword를 설정하고 Local Apple/Android ASR을 사용하십시오. WakeWord 프로필이 사용되면 WakeWord.filter, wakeword.encode 및 wakeword.detect가 필요합니다.
types.ts : 12
• tflite_wakeword_spokestack_asr = 3
WakeWord를 설정하고 원격 스포크 스택 ASR을 사용하십시오. WakeWord 프로필이 사용되면 WakeWord.filter, wakeword.encode 및 wakeword.detect가 필요합니다.
types.ts : 30
• vad_keyword_asr = 7
VAD 트리거 TFLITE 키워드 인식기
types.ts : 50
• vad_native_asr = 1
Apple/Android 자동 음성 인식은 음성 활성 감지가 트리거 할 때 켜져 있습니다.
types.ts : 17
• VAD_SPOKESTACK_ASR = 4
Spokestack 자동 음성 인식이 음성 활성 감지가 트리거 할 때 켜져 있습니다.
types.ts : 35
• Optional agccompressiongaindb : number
advanced
AcousticGainControl 용 Android 전용
-9dB의 피크를 유지하려면 -DB의 대상 피크 오디오 레벨을 사용하여 9의 값을 구성하십시오.
types.ts : 192
• Optional AGCTARGETLEVELDBFS : number
advanced
AcousticGainControl 용 Android 전용
DBFS의 동적 범위 압축 속도
types.ts : 200
• Optional anspolicy : "aggressive" | "very-aggressive" | "mild" | "medium"
advanced
AcousticNoisesuppressor 용 Android 전용
소음 정책
types.ts : 183
• Optional BufferWidth : number
advanced
버퍼 크기를 결정하기 위해 framewidth와 함께 사용되는 버퍼 너비
type.ts : 155
• Optional Framewidth : number
advanced
음성 프레임 너비, MS
types.ts : 149
• Optional 프로필 : PipelineProfile
프로파일은 파이프 라인 단계를위한 공통 구성 모음입니다.
프로필이 명시 적으로 설정되지 않으면 Spokestack은 Spokestack.initialize() 로 전달 된 구성을 기반으로 현명한 기본 프로파일을 결정합니다.
WakeWord 구성 파일이 설정된 경우 (및 키워드 구성이 아님) 기본값은 TFLITE_WAKEWORD_NATIVE_ASR 로 설정됩니다.
키워드 구성 파일이 설정된 경우 (wakeword 구성이 아닌 경우) 기본값은 VAD_KEYWORD_ASR 로 설정됩니다.
WakeWord 및 키워드 구성 파일이 모두 설정되면 기본값이 TFLITE_WAKEWORD_KEYWORD 로 설정됩니다.
그렇지 않으면 기본값은 PTT_NATIVE_ASR 입니다.
types.ts : 139
• Optional 샘플 리터 : number
HZ의 오디오 샘플링 속도
types.ts : 143
• Optional vadfalldelay : number
advanced
MS의 하락 에지 감지 실행 길이; 이 값은 탐지기를 음수로 뒤집기 위해 얼마나 많은 음의 샘플을 수신 해야하는지 결정합니다.
types.ts : 166
• Optional Vadmode : "quality" | "low-bitrate" | "aggressive" | "very-aggressive"
음성 활동 감지기 모드
types.ts : 159
• Optional VadrisedElay : number
advanced
안드로이드 전용
MS의 상승 에지 감지 실행 길이; 이 값은 탐지기를 양성으로 뒤집기 위해 얼마나 많은 양의 샘플을 받아야하는지 결정합니다.
types.ts : 175
• 메타 데이터 : string | number
NLU 메타 데이터의 JSON 파일. 지정된 경우 모델 및 어휘도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 객체 (예 : metadata: require('./metadata.sjson') ). 중요 : require 또는 import 사용할 때 로컬 메타 데이터 JSON 파일 ( .sjson )에 특수 확장이 사용되므로 포함시 파일이 구문 분석되지 않고 소스 개체로 가져옵니다. 이렇게하면 파일을 기본 기본 라이브러리에서 읽고 구문 분석 할 수 있습니다.
types.ts : 223
• 모델 : string | number
NLU 텐서 플로우 라이트 모델. 지정된 경우 메타 데이터 및 어휘도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 개체 (예 : model: require('./nlu.tflite') ) types.ts : 211
• 어휘 : string | number
NLU 어휘를 포함하는 TXT 파일. 지정된 경우 모델 및 메타 데이터도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 개체 (예 vocab: require('./vocab.txt') ) types.ts : 231
• Optional 입력 길이 : number
types.ts : 244
• 감지 : string | number
"감지"텐서 플로 라이트 모델. 지정된 경우 필터 및 인코딩도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import detect: require('./detect.tflite')인코드 모델은 MEL 프레임보다 각각의 자동 회귀 단계를 수행하는 데 사용됩니다. 입력은 추가 상태 입력/출력 형성 [State-Width]과 함께 [Mel-Length, Mel-Width] 및 출력 [Encode-Width]으로 형성되어야합니다.
types.ts : 272
• 인코딩 : string | number
"Encode"Tensorflow-Lite 모델. 지정된 경우 필터 및 감지도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 객체 (예 encode: require('./encode.tflite') )입력은 [Encode-Length, Encode width] 형성되어야하며 출력이 있어야합니다.
types.ts : 283
• 필터 : string | number
"필터"텐서 플로우 라이트 모델. 지정된 경우, 감지 및 인코딩도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 개체 (예 : filter: require('./filter.tflite') )필터 모델은 선형 STFT에서 MEL 스펙트럼 프레임을 계산하는 데 사용됩니다. 입력은 [fft-width] 형성되어야하며 출력 [Mel-Width]
types.ts : 260
• Optional ActiveMax : number
advanced
활성화의 최대 길이는 밀리 초 단위로 활성화를 시간에 시간을내는 데 사용됩니다.
type.ts : 373
• Optional 활성화민 : number
advanced
웨이크 워드 후 VAD 비활성화를 무시하는 데 사용되는 밀리 초의 활성화의 최소 길이
types.ts : 366
• Optional 요청 타임 아웃 : number
iOS 전용
Apple ASR 요청이 밀리 초로 실행되도록하는 시간. 애플은 요청 당 문서화되지 않은 제한이 60000ms입니다.
type.ts : 380
• Optional RMSALPHA : number
advanced 안드로이드 전용
현재 RMS 신호 에너지에 대한 기하 급수적으로 가중 이동 평균 (EWMA) 업데이트 속도 (RMS 정규화 없음 0)
type.ts : 397
• Optional RMSTARGET : number
advanced 안드로이드 전용
원하는 선형 루트 평균 제곱 (RMS) 신호 에너지는 신호 정규화에 사용되며 훈련 중에 사용되는 RMS 대상으로 조정해야합니다.
type.ts : 389
• Optional 웨이크 워드 : string | string []
iOS 전용
필터를 전달하지 않고 경로를 감지하고 인코딩 할 때만 필요한 순서 배열 또는 쉼표로 구분 된 Wakeword 키워드 목록.
types.ts : 404
• 감지 : string | number
"감지"텐서 플로 라이트 모델. 지정된 경우 필터 및 인코딩도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import detect: require('./detect.tflite')인코드 모델은 MEL 프레임보다 각각의 자동 회귀 단계를 수행하는 데 사용됩니다. 입력은 추가 상태 입력/출력 형성 [State-Width]과 함께 [Mel-Length, Mel-Width] 및 출력 [Encode-Width]으로 형성되어야합니다.
types.ts : 272
• 인코딩 : string | number
"Encode"Tensorflow-Lite 모델. 지정된 경우 필터 및 감지도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 객체 (예 encode: require('./encode.tflite') )입력은 [Encode-Length, Encode width] 형성되어야하며 출력이 있어야합니다.
types.ts : 283
• 필터 : string | number
"필터"텐서 플로우 라이트 모델. 지정된 경우, 감지 및 인코딩도 필요합니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 개체 (예 : filter: require('./filter.tflite') )필터 모델은 선형 STFT에서 MEL 스펙트럼 프레임을 계산하는 데 사용됩니다. 입력은 [fft-width] 형성되어야하며 출력 [Mel-Width]
types.ts : 260
metadata 또는 classes 필요하며 상호 배타적입니다.
• 메타 데이터 : string | number
키워드 메타 데이터의 JSON 파일. keyword.classes 지정되지 않은 경우 필수입니다.
이 필드는 2 가지 유형의 값을 수용합니다.
require 또는 import 에 의해 검색된 소스 객체 (예 : metadata: require('./metadata.sjson') ). 중요 : require 또는 import 사용할 때 로컬 메타 데이터 JSON 파일 ( .sjson )에 특수 확장이 사용되므로 포함시 파일이 구문 분석되지 않고 소스 개체로 가져옵니다. 이렇게하면 파일을 기본 기본 라이브러리에서 읽고 구문 분석 할 수 있습니다.
type.ts : 424
• 클래스 : string | string []
쉼표로 구분 된 목록 또는 키워드에 대한 주문 클래스 이름 배열. 가장 가능성이 높은 클래스에 해당하는 이름은 인식 이벤트가 제기 될 때 성적표 필드에서 반환됩니다. keyword.metadata 지정되지 않은 경우 필수입니다.
type.ts : 434
이러한 속성은 wakeword 또는 keyword 구성 객체로 전달 될 수 있지만 공유 할 수 없습니다.
• Optional 코링 길이 : number
advanced
분류기에 대한 입력으로 사용되는 인코더 출력의 슬라이딩 윈도우의 길이, 밀리 초
type.ts : 293
• Optional 인코딩 : number
advanced
벡터 유닛에서 인코더 출력의 크기
type.ts : 299
• Optional FFTHOPLENGTH : number
advanced
겹치는 STFT가 계산 될 때마다 건너 뛰는 시간은 밀리 초입니다.
type.ts : 322
• Optional FFTWindowsize : number
advanced
STFT를 샘플 수에서 계산하는 데 사용되는 신호 창의 크기는 최대 효율을 위해 2의 전력이어야합니다.
types.ts : 306
• Optional FFTWINDOWTYPE : string
advanced
안드로이드 전용
STFT를 계산하기 전에 각 오디오 프레임에 적용 할 창 함수의 이름; 현재 "Hann"창이 지원됩니다
types.ts : 315
• Optional Melframelenger : number
advanced
겹치는 STFT가 계산 될 때마다 건너 뛰는 시간은 밀리 초입니다.
type.ts : 329
• Optional melframewidth : number
advanced
필터 뱅크 구성 요소 수의 각 MEL 스펙트로 그램 프레임의 크기
type.ts : 336
• Optional 사전 강화 : number
advanced
정규화 된 오디오 신호에 적용되는 강조 전 필터 무게 (사전 뒷받침의 경우 0)
type.ts : 343
• Optional StateWidth : number
advanced
인코더 상태의 크기 (벡터 단위)
type.ts : 349
• Optional 임계 값 : number
advanced
분류기의 후방 출력의 임계 값은 위에 트리거가 파이프 라인을 활성화합니다. [0, 1]
type.ts : 356
아파치 -2.0
Copyright 2021 Spokestack