Comments (5)
Same issue. Did you find the solution?
from speech_to_text.
Sorry for the delay. I'll try a new project myself. In the meantime I'd suggest opening the project in Xcode and set the Swift version there.
from speech_to_text.
Hey, thank you for looking into it. No solution yet. I have been setting the Swift version in Xcode, but it looks like I get the same issue. I might have some more time to investigate this week.
from speech_to_text.
I have Flutter 1.12.13+Hotfix.8
Here's what I tried:
- flutter create --org com.csdcorp --ios-language swift --android-language kotlin .
- build and launch the resulting project for iOS, all working
- add
speech_to_text: ^1.1.0
to pubspec.yaml dependencies - rebuild and launch, all working
- add speech to text to main.dart and initialize it
- add required permission descriptions to Info.plist
- rebuild and launch, all working, speech recognition functional
So there doesn't appear to be a compile problem with the plugin and the latest version of Flutter. Can you tell me if I've done something differently than you're doing? Here's the full source of main.dart in case it's of help. I made only the minimal changes required to the example program to add a simple speech usage to it.
import 'package:flutter/material.dart';
import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
SpeechToText _speechToText;
bool _speechReady = false;
String _wordsSpoken = "";
int _counter = 0;
@override
void initState() {
super.initState();
_startSpeech();
}
Future<void> _startSpeech() async {
_speechToText = SpeechToText();
_speechReady = await _speechToText.initialize();
if (_speechReady) {
_speechToText.listen(onResult: _resultHandler, partialResults: true);
}
setState(() {});
}
void _resultHandler(SpeechRecognitionResult result) {
setState(() {
_wordsSpoken = result.recognizedWords;
});
}
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(_speechReady ? 'Speech is now ready' : 'Speech not ready yet'),
Text(_wordsSpoken),
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
}
from speech_to_text.
Hi there, sorry for the delay and thank you for sharing the example. I can confirm that there is no compile issue anymore with the latest package. I took these steps, in addition to:
- updating to the latest version
speech_to_text: '>=2.0.1'
, - updating to the latest version of xcode 11.4 (possibly unrelated to this working)
- running
pod disintegrate
and thenpod install
in my project(s).
Thanks for your help!
from speech_to_text.
Related Issues (20)
- Started listening without any error but cant get speechResult on SM-G9650/DS HOT 1
- in Android HOT 1
- Error when build with real device HOT 2
- W/Bundle (11745): Key results_recognition expected ArrayList<String> but value was a java.lang.String. The default value <null> was returned. HOT 1
- Continuous listening HOT 1
- Can't get locales on Android HOT 6
- Compound words issue HOT 2
- [Question:About hiragana in Japanese] HOT 2
- Fails to function with car's Bluetooth connection HOT 2
- 'error_no_match' does not get fired when user stops listening HOT 1
- Not work with airpods in iOS HOT 1
- iOS often misses the first word after calling `.listen()` for n+1 times HOT 3
- Request to Add Option to Disable Notification Sound on Android HOT 2
- [iOS] Entering page again to initialize, the last statusListener is unable to update widgets. HOT 1
- Arabic diacritics (Harakat) HOT 1
- iOS, onResult is not called HOT 7
- Getting Error 7 after start. HOT 7
- OnDevice doesnโt work if wifi is turned off HOT 1
- how to clear result.recognizedWords HOT 1
- Wan't to Add some extra languages, working in andriod but thworing exception in IOS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from speech_to_text.