[Plugins] Construct2 Cordova Plugins

Post your completed addons to share with the community

Post » Tue Aug 19, 2014 12:52 pm

one more thing!!
Will you add this plugin too?(Voice to text)

Code: Select all
<html>
<head><meta charset="utf-8" /></head>
<body>
<script type="text/javascript">
var infoBox; // 訊息 label
var textBox; // 最終的辨識訊息 text input
var tempBox; // 中間的辨識訊息 text input
var startStopButton; // 「辨識/停止」按鈕
var final_transcript = ''; // 最終的辨識訊息的變數
var recognizing = false; // 是否辨識中

function startButton(event) {
  infoBox = document.getElementById("infoBox"); // 取得訊息控制項 infoBox
  textBox = document.getElementById("textBox"); // 取得最終的辨識訊息控制項 textBox
  tempBox = document.getElementById("tempBox"); // 取得中間的辨識訊息控制項 tempBox
  startStopButton = document.getElementById("startStopButton"); // 取得「辨識/停止」這個按鈕控制項
  langCombo = document.getElementById("langCombo"); // 取得「辨識語言」這個選擇控制項
  if (recognizing) { // 如果正在辨識,則停止。
    recognition.stop();
  } else { // 否則就開始辨識
    textBox.value = ''; // 清除最終的辨識訊息
    tempBox.value = ''; // 清除中間的辨識訊息
    final_transcript = ''; // 最終的辨識訊息變數
    recognition.lang = langCombo.value; // 設定辨識語言
    recognition.start(); // 開始辨識
  }
}

if (!('webkitSpeechRecognition' in window)) {  // 如果找不到 window.webkitSpeechRecognition 這個屬性
  // 就是不支援語音辨識,要求使用者更新瀏覽器。
  infoBox.innerText = "本瀏覽器不支援語音辨識,請更換瀏覽器!(Chrome 25 版以上才支援語音辨識)";
} else {
  var recognition = new webkitSpeechRecognition(); // 建立語音辨識物件 webkitSpeechRecognition
  recognition.continuous = true; // 設定連續辨識模式
  recognition.interimResults = true; // 設定輸出中先結果。

  recognition.onstart = function() { // 開始辨識
    recognizing = true; // 設定為辨識中
    startStopButton.value = "按此停止"; // 辨識中...按鈕改為「按此停止」。 
    infoBox.innerText = "辨識中...";  // 顯示訊息為「辨識中」...
  };

  recognition.onend = function() { // 辨識完成
    recognizing = false; // 設定為「非辨識中」
    startStopButton.value = "開始辨識";  // 辨識完成...按鈕改為「開始辨識」。
    infoBox.innerText = ""; // 不顯示訊息
  };

  recognition.onresult = function(event) { // 辨識有任何結果時
    var interim_transcript = '';
    for (var i = event.resultIndex; i < event.results.length; ++i) {
      if (event.results[i].isFinal) {
        final_transcript += event.results[i][0].transcript;
      } else {
        interim_transcript += event.results[i][0].transcript;
      }
    }
    if (final_transcript.trim().length > 0)
        textBox.value = final_transcript;
    if (interim_transcript.trim().length > 0)
        tempBox.value = interim_transcript;
  };
}
</script>   
<BR/>
last:<input id="textBox" type="text" size="60" value=""/><BR/>
mid:<input id="tempBox" type="text" size="60" value=""/><BR/>
Lan:
<select id="langCombo">
  <option value="en-US">en-US</option>
  <option value="cmn-Hant-TW">中文(台灣)</option>
</select>
<input id="startStopButton" type="button" value="Start" onclick="startButton(event)"/><BR/>
<label id="infoBox"></label>
</body>
</html>
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Tue Aug 19, 2014 6:22 pm

@fongka2
Ran this example in chrome.
But "recognition.onstart" event is not fired
Only "recognition.onend" event is fired
I have no mike.
Is this normal?
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Wed Aug 20, 2014 11:07 am

cranberrygame wrote:@fongka2
Ran this example in chrome.
But "recognition.onstart" event is not fired
Only "recognition.onend" event is fired
I have no mike.
Is this normal?

Oh... :roll:
let me try later
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Wed Aug 20, 2014 12:43 pm

@cranberry I think there's a bug in the local notification plugin... even if I put 20 or 200 seconds in the 'delay' parameter, the notification still gets sent instantly :S
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Wed Aug 20, 2014 4:23 pm

@alvarop

I will add it to to-do list

Ejecta wrapper (for ios) is mainly used for performance.

@TwinTails

Fixed only instantly bug.
Thanks
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Wed Aug 20, 2014 11:13 pm

Hi Cranberrygame!

I'm sorry, I tried to reach you by PM, but I think maybe something went wrong while the system was down. Can you contact me back. I have a project which I think only you can help me with. It will be a paid job, so please contact me asap as I have a tight schedule for it. Thanks!
B
17
S
2
Posts: 34
Reputation: 853

Post » Thu Aug 21, 2014 1:48 am

@cranberrygame I was hoping there was a way to integrate Admob with ejecta, as Phonegap doesn't have good performance yet. Do you know of any way I could make that work?
B
33
S
9
G
3
Posts: 493
Reputation: 4,042

Post » Thu Aug 21, 2014 3:38 am

@Pariunos

Check PM

@alvarop

I added Ejecta Admob to to-do list
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Thu Aug 21, 2014 4:11 am

QR CODE PLUGIN BUILD FAIL @ INTELXDK
Error: Plugin failed to install: barcodescanner (https://github.com/phonegap-build/Barco ... 3b4955dce2)
(I donated again(American Express Credit Card XXXX-XXXXXX-X5473),plz check)
B
17
S
7
Posts: 360
Reputation: 2,202

Post » Thu Aug 21, 2014 6:02 am

@fongka2

Do not select all plugins in "Included Plugins" tab, select Minimum is recommended.

Then errors will disappear.

Thanks for your donation very much.
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest