This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.akirayou.speech_recognizer; | |
import android.view.KeyEvent; | |
import com.unity3d.player.UnityPlayerActivity; | |
import static com.unity3d.player.UnityPlayer.UnitySendMessage; | |
public class VolKeyUnityPlayerActivity extends UnityPlayerActivity { | |
static private String callbackGameObjectUp="", callbackMethodUp=""; | |
final static private String returnValueUp="VOLUME_UP"; | |
static private String callbackGameObjectDown="", callbackMethodDown=""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.akirayou.speech_recognizer; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.speech.RecognitionListener; | |
import android.speech.RecognizerIntent; | |
import android.speech.tts.TextToSpeech; | |
import android.util.Log; | |
import java.util.Locale; | |
import android.content.Intent; | |
import static com.unity3d.player.UnityPlayer.UnitySendMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="net.akirayou.speech_recognizer" > | |
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class SpeechRecog : MonoBehaviour { | |
AndroidJavaObject nativeRecognizer; | |
AndroidJavaClass keyHook; | |
[SerializeField] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.unity3d.player" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:installLocation="preferExternal"> | |
<supports-screens | |
android:smallScreens="true" | |
android:normalScreens="true" | |
android:largeScreens="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
android { | |
compileSdkVersion 29 | |
buildToolsVersion "29.0.2" | |
defaultConfig { | |
minSdkVersion 22 | |
targetSdkVersion 29 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static unsigned long wdt=0; | |
#include <WiFi.h> | |
#include <WiFiUDP.h> | |
const char *ssid = "NETLED"; | |
const char *password = "yamashiro"; | |
void wifiLoop(unsigned long diffMs){ | |
static bool needUdpSetup=true; | |
static WiFiUDP udp; | |
static int wifiCount=100000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Library for driving digital RGB(W) LEDs using the ESP32's RMT peripheral | |
* | |
* Modifications Copyright (c) 2017 Martin F. Falatic | |
* | |
* Based on public domain code created 19 Nov 2016 by Chris Osborn <fozztexx@fozztexx.com> | |
* http://insentricity.com | |
* | |
*/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Library for driving digital RGB(W) LEDs using the ESP32's RMT peripheral | |
* | |
* Modifications Copyright (c) 2017 Martin F. Falatic | |
* | |
* Based on public domain code created 19 Nov 2016 by Chris Osborn <fozztexx@fozztexx.com> | |
* http://insentricity.com | |
* | |
*/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///初期化例 | |
static const int nofCh=8; | |
static const char ledPins[nofCh]={32,33,25,26 ,27,14,13,16 }; | |
static const char nofLed[nofCh]={281,281,281,281, 281,281,281,281}; | |
static strand_t hLed[nofCh];//各チャンネルを管理する構造体 | |
void initLed(void){ | |
for(int i=0;i<nofCh;i++){ | |
log_i("ch:%d, gpio:%d,nofLed:%d",i,ledPins[i],nofLed[i]); |