diff --git a/dist/voice-recognition.html b/dist/voice-recognition.html
index 5236ff4..8fa55eb 100644
--- a/dist/voice-recognition.html
+++ b/dist/voice-recognition.html
@@ -10,6 +10,12 @@
type: Boolean,
value: true
},
+ accent: {
+ type: String,
+ value: 'en-US',
+ observer: '_accentChanged',
+ notify: true
+ },
text: {
type: String,
value: ''
@@ -43,6 +49,9 @@
},
/* -- Private Methods ------------------------------------------- */
+ _accentChanged: function() {
+ this.recognition.lang = this.accent;
+ },
_propagateEvent: function (eventName) {
var that = this;
@@ -55,7 +64,7 @@
this.recognition.addEventListener('result', function(e) {
for (var i = e.resultIndex; i < e.results.length; ++i) {
- that.text += e.results[i][0].transcript;
+ that.text = e.results[i][0].transcript;
e.result = that.text;
}
diff --git a/src/voice-recognition.html b/src/voice-recognition.html
index 4dd9385..812c883 100644
--- a/src/voice-recognition.html
+++ b/src/voice-recognition.html
@@ -64,7 +64,7 @@
this.recognition.addEventListener('result', function(e) {
for (var i = e.resultIndex; i < e.results.length; ++i) {
- that.text += e.results[i][0].transcript;
+ that.text = e.results[i][0].transcript;
e.result = that.text;
}