Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Падает через пару фраз #98

Open
db-exp opened this issue May 30, 2021 · 3 comments
Open

Падает через пару фраз #98

db-exp opened this issue May 30, 2021 · 3 comments

Comments

@db-exp
Copy link

db-exp commented May 30, 2021

Создал согласно документации

                             val config = YandexSpeechToText.Config(
                                enablePartialResults = false,
                                enableLoggingData = true
                            )
                            val iAmTokenGenerator =
                                IAmTokenGenerator("OAuth")

                            val yandexSpeechKitRecognizer = YandexSpeechToText(
                                iAmTokenGenerator,
                                "folderId",
                                Language.EN,
                                config
                            )

                            if (ActivityCompat.checkSelfPermission(
                                    this,
                                    Manifest.permission.RECORD_AUDIO
                                ) != PackageManager.PERMISSION_GRANTED
                            ) {
                                checkPermissions()
                            } else {
                                val r = yandexSpeechKitRecognizer.startRecognition()
                                GlobalScope.launch {
                                    r.consumeEach { it ->
                                        Log.i(TAG, "$it")
                                    }
                                }
                            }

После отправки пары сообщений падает

java.lang.IllegalStateException: Flow exception transparency is violated:
Previous 'emit' call has thrown exception java.lang.IllegalStateException: Flow exception transparency is violated:
Previous 'emit' call has thrown exception java.lang.IllegalStateException: Flow exception transparency is violated:
Previous 'emit' call has thrown exception java.lang.IllegalStateException: Flow exception transparency is violated:
Previous 'emit' call has thrown exception kotlin.UninitializedPropertyAccessException: lateinit property eventChannel has not been initialized, but then emission attempt of value '[B@15100dc' has been detected.
Emissions from 'catch' blocks are prohibited in order to avoid unspecified behaviour, 'Flow.catch' operator can be used instead.
For a more detailed explanation, please refer to Flow documentation., but then emission attempt of value '[B@3e895e5' has been detected.

Помогите, пожалуйста

@db-exp
Copy link
Author

db-exp commented May 30, 2021

без создания speechtotext, texttospech, dialog и общего AiMyBox не работает, вопрос - можно ли как-то отдельно создать только speechtotext?

@morfeusys
Copy link
Collaborator

@db-exp вроде согласно документации немного по-другому. Пробовали так же?

@bgubanov
Copy link
Contributor

Дело в том, что YandexSpeechToText, как и любой STT компонент, наследуется от абстрактного класса SpeechToText, для работы которого необходимо инициализировать eventChannel (свойство типа SendChannel, которое необходимо, для передачи пользователю Aimybox событий STT компонента), данное свойство объявлено как internal, поэтому чтобы запустить SpeechToText, необходимо либо запускать его в составе Aimybox, либо выкачивать код модуля core и инициализировать в нем eventChannel самостоятельно

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants