Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        if (AndroidRuntimePermissions.CheckPermission("android.permission.RECORD_AUDIO") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.RECORD_AUDIO");
        }
        if (AndroidRuntimePermissions.CheckPermission("android.permission.ACCESS_FINE_LOCATION") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.ACCESS_FINE_LOCATION");
        }
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        // set the calling package this is optional
        // you can use this if your app is for children or kids
        speechPlugin.SetCallingPackage("com.mycoolcompany.mygame");

        AddSpeechPluginListener();
    }
Exemplo n.º 2
0
    void Start()
    {
        if (AndroidRuntimePermissions.CheckPermission("android.permission.RECORD_AUDIO") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.RECORD_AUDIO");
        }
        if (AndroidRuntimePermissions.CheckPermission("android.permission.WRITE_EXTERNAL_STORAGE") != AndroidRuntimePermissions.Permission.Granted)
        {
            AndroidRuntimePermissions.RequestPermission("android.permission.WRITE_EXTERNAL_STORAGE");
        }
        if (GameObject.FindGameObjectsWithTag("SceneThemeAudio").Length > 0)
        {
            sceneTheme = GameObject.FindGameObjectsWithTag("SceneThemeAudio")[0];
        }

        Bihou = GameObject.FindGameObjectWithTag("Bihou");

        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        // set the calling package this is optional
        // you can use this if your app is for children or kids
        speechPlugin.SetCallingPackage("com.mycoolcompany.mygame");

        AddSpeechPluginListener();
    }
    private void Awake()
    {
#if UNITY_ANDROID
        if (Application.platform != RuntimePlatform.Android)
        {
            return;
        }

        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();
        textToSpeechPlugin.OnInit         += OnInit;
        textToSpeechPlugin.OnChangeLocale += OnSetLocale;
        textToSpeechPlugin.OnStartSpeech  += OnStartSpeech;
        textToSpeechPlugin.OnEndSpeech    += OnEndSpeech;
        textToSpeechPlugin.OnErrorSpeech  += OnErrorSpeech;
#endif
    }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        AddSpeechPluginListener();
    }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.setSpeechEventListener(onReadyForSpeech, onBeginningOfSpeech, onEndOfSpeech, onError, onResults);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Init();
        textToSpeechPlugin.SetTextToSpeechCallbackListener(OnInit, OnGetLocaleCountry, OnSetLocale, OnStartSpeech, OnDoneSpeech, OnErrorSpeech);
    }
Exemplo n.º 6
0
    public static SpeechPlugin GetInstance()
    {
        if(instance==null){
            container = new GameObject();
            container.name="SpeechPlugin";
            instance = container.AddComponent( typeof(SpeechPlugin) ) as SpeechPlugin;
            DontDestroyOnLoad(instance.gameObject);
        }

        return instance;
    }
Exemplo n.º 7
0
    public static SpeechPlugin GetInstance()
    {
        if(instance==null){
            container = new GameObject();
            container.name="SpeechPlugin";
            instance = container.AddComponent( typeof(SpeechPlugin) ) as SpeechPlugin;
            DontDestroyOnLoad(instance.gameObject);
            aupHolder = AUPHolder.GetInstance();
            instance.gameObject.transform.SetParent(aupHolder.gameObject.transform);
        }

        return instance;
    }
Exemplo n.º 8
0
    private void Awake()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
    }
Exemplo n.º 9
0
    // Use this for initialization
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        AddSpeechPluginListener();
    }
Exemplo n.º 10
0
    public static SpeechPlugin GetInstance()
    {
        if (instance == null)
        {
            container      = new GameObject();
            container.name = "SpeechPlugin";
            instance       = container.AddComponent(typeof(SpeechPlugin)) as SpeechPlugin;
            DontDestroyOnLoad(instance.gameObject);
            aupHolder = AUPHolder.GetInstance();
            instance.gameObject.transform.SetParent(aupHolder.gameObject.transform);
        }

        return(instance);
    }
Exemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);


        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.LoadLocaleCountry();
        textToSpeechPlugin.LoadCountryISO2AlphaCountryName();
        textToSpeechPlugin.Init();
        textToSpeechPlugin.SetTextToSpeechCallbackListener(OnInit, OnGetLocaleCountry, OnSetLocale, OnStartSpeech, OnDoneSpeech, OnErrorSpeech);

        CheckTTSDataActivity();
    }
Exemplo n.º 12
0
    private void Awake()
    {
        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        textToSpeechPlugin.OnInit         += OnInit;
        textToSpeechPlugin.OnChangeLocale += OnSetLocale;
        textToSpeechPlugin.OnStartSpeech  += OnStartSpeech;
        textToSpeechPlugin.OnEndSpeech    += OnEndSpeech;
        textToSpeechPlugin.OnErrorSpeech  += OnErrorSpeech;
    }
Exemplo n.º 13
0
    private void Awake()
    {
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        //textToSpeechPlugin.OnInit += this.OnInit;
        //textToSpeechPlugin.OnEndSpeech += this.OnEndSpeech;
    }
Exemplo n.º 14
0
    // Use this for initialization
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        // set the calling package this is optional
        // you can use this if your app is for children or kids
        speechPlugin.SetCallingPackage("com.mycoolcompany.mygame");

        AddSpeechPluginListener();
    }
Exemplo n.º 15
0
    private void Awake()
    {
        dispatcher = Dispatcher.GetInstance();
        // for accessing audio
        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        textToSpeechPlugin.OnInit         += OnInit;
        textToSpeechPlugin.OnChangeLocale += OnSetLocale;
        textToSpeechPlugin.OnStartSpeech  += OnStartSpeech;
        textToSpeechPlugin.OnEndSpeech    += OnEndSpeech;
        textToSpeechPlugin.OnErrorSpeech  += OnErrorSpeech;
    }
Exemplo n.º 16
0
    void Start()
    {
        dispatcher = Dispatcher.GetInstance();

        utilsPlugin = UtilsPlugin.GetInstance();
        utilsPlugin.SetDebug(0);

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.Init();

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();

        AddSpeechPluginListener();
        AddTextToSpeechListener();

        apiaiClient = new ApiAiUnity();
        apiaiClient.Initialize(new AIConfiguration("a984bc306ae24d11b4105e251f892a21", SupportedLanguage.English));
    }
Exemplo n.º 17
0
 public ScriptSpeech(SpeechPlugin plugin)
 {
     this.plugin = plugin;
 }
Exemplo n.º 18
0
    // Use this for initialization
    void Start()
    {
        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.LoadLocaleCountry();
        textToSpeechPlugin.LoadCountryISO2AlphaCountryName();
        textToSpeechPlugin.Init();
        textToSpeechPlugin.SetTextToSpeechCallbackListener(OnInit,OnGetLocaleCountry,OnSetLocale,OnStartSpeech,OnDoneSpeech,OnErrorSpeech);

        CheckTTSDataActivity();
    }
Exemplo n.º 19
0
    void Start()
    {
        toast = FindObjectOfType (typeof(Toast)) as Toast;

        texts [(int)(State.SitDown)] = textSitDown;
        texts [(int)(State.FallDown)] = textFallDown;
        texts [(int)(State.StandUp)] = textStandUp;
        texts [(int)(State.LeftArm)] = textLeftArm;
        texts [(int)(State.RightArm)] = textRightArm;

        goDog = GameObject.FindGameObjectWithTag ("dog");
        interact = FindObjectOfType (typeof(Interact)) as Interact;

        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.setSpeechEventListener(onReadyForSpeech,onBeginningOfSpeech,onEndOfSpeech,onError,onResults);
    }
Exemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
        speechPlugin = SpeechPlugin.GetInstance();
        speechPlugin.SetDebug(0);
        speechPlugin.setSpeechEventListener(onReadyForSpeech,onBeginningOfSpeech,onEndOfSpeech,onError,onResults);

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Init();
        textToSpeechPlugin.SetTextToSpeechCallbackListener(OnInit,OnGetLocaleCountry,OnSetLocale,OnStartSpeech,OnDoneSpeech,OnErrorSpeech);
    }