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
    }
Пример #2
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);
    }
Пример #3
0
    //Initialization
    private void Awake()
    {
        BluetoothAdapter.enableBluetooth();//Force Enabling Bluetooth
        BluetoothAdapter.OnDevicePicked  += HandleOnDevicePicked;
        BluetoothAdapter.OnClientRequest += HandleOnClientRequest;
        BluetoothAdapter.startServer(UUID, 1000); // Init server

        textToSpeechPlugin = TextToSpeechPlugin.GetInstance();
        textToSpeechPlugin.SetDebug(0);
        textToSpeechPlugin.Initialize();
    }
Пример #4
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);
    }
Пример #5
0
    public static TextToSpeechPlugin GetInstance()
    {
        if(instance==null){
            container = new GameObject();
            container.name="TextToSpeechPlugin";
            instance = container.AddComponent( typeof(TextToSpeechPlugin) ) as TextToSpeechPlugin;
            DontDestroyOnLoad(instance.gameObject);
            aupHolder = AUPHolder.GetInstance();
            instance.gameObject.transform.SetParent(aupHolder.gameObject.transform);
        }

        return instance;
    }
Пример #6
0
    public static TextToSpeechPlugin GetInstance()
    {
        if (instance == null)
        {
            container      = new GameObject();
            container.name = "TextToSpeechPlugin";
            instance       = container.AddComponent(typeof(TextToSpeechPlugin)) as TextToSpeechPlugin;
            DontDestroyOnLoad(instance.gameObject);
            aupHolder = AUPHolder.GetInstance();
            instance.gameObject.transform.SetParent(aupHolder.gameObject.transform);
        }

        return(instance);
    }
Пример #7
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;
    }
Пример #8
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();
    }
Пример #9
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;
    }
Пример #10
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;
    }
Пример #11
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));
    }
Пример #12
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);
    }
Пример #13
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();
    }