Ejemplo n.º 1
0
    //public static voiceLogin Instance = null;

    private void Awake() // 각 Scene에 들어왔을때 가장 먼저 실행.
    {
        //Debug.Log("voiceUI Awake");
        //싱글턴 패턴 object로 만들어줌
        //if (Instance == null)
        //    Instance = this;
        //else if (Instance != this)
        //    Destroy(gameObject);
        //DontDestroyOnLoad(gameObject);

        OnEnable();

        _voiceManager        = VoiceManager.Instance;
        _networkroommanager  = GameObject.Find("NetworkRoomManager");
        _voiceNetworkManager = _networkroommanager.GetComponent <NetworkManagerHUDWBTB>();

        _voiceManager.OnUserLoggedInEvent  += OnUserLoggedIn;   // user login event 구독
        _voiceManager.OnUserLoggedOutEvent += OnUserLoggedOut;  // user logout event 구독

        if (_voiceManager.loginState == LoginState.LoggedIn)    // login state가 loggedin인 경우
        {
            OnUserLoggedIn();
        }
        else
        {
            OnUserLoggedOut();
        }

        _voiceManager.AudioInputDevices.Muted = true;
        _voiceManager.setEchoCancelation(true);
        StartCoroutine(getPlayer());
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Initialise le script
    /// </summary>
    private void Start()
    {
        // Affectation singleton

        VoiceManager.Instance = this;

        // Création des mots a chercher

        this._keywordsList = new Dictionary <string, string>();
        this._keywordsList.Add(VoiceManager.WAKE_UP_KEYWORD + this.MenuRed, this.MenuRed);
        this._keywordsList.Add(VoiceManager.WAKE_UP_KEYWORD + this.MenuBlue, this.MenuBlue);
        this._keywordsList.Add(VoiceManager.WAKE_UP_KEYWORD + this.MenuYellow, this.MenuYellow);
        this._keywordsList.Add(VoiceManager.WAKE_UP_KEYWORD + this.MenuReset, this.MenuReset);

        // Transfert des référence

        string[] keywordListString = new string[this._keywordsList.Count];

        this._keywordsList.Keys.CopyTo(keywordListString, 0);

        // Création du moteur de reconnaissance vocale

        this._keywordRecognizer = new KeywordRecognizer(keywordListString);
        this._keywordRecognizer.OnPhraseRecognized += this.OnPhraseRecognized;
        this._keywordRecognizer.Start();
    }
Ejemplo n.º 3
0
    public override void OnLeaveRoom()
    {
        Debug.Log("OnLeaveRoom");

        if (ChatManager.IsConnect())
        {
            ChatManager.Disconnect();
        }

        if (VoiceManager.IsConnect())
        {
            VoiceManager.Disconnect();
        }

        if (DemoControlManager.Instance.currentState != DemoState.room)
        {
            return;
        }


        Camera.main.clearFlags = CameraClearFlags.SolidColor;
        Instantiate(MenuPrefab);
        DemoControlManager.Instance.currentState = DemoState.menu;
        GameObject thisPrefab = this.transform.parent.gameObject;

        if (thisPrefab != null)
        {
            Destroy(thisPrefab);
        }


        // SceneManager.LoadScene("DemoMenuScene");
    }
Ejemplo n.º 4
0
    private void Awake()
    {
        _textChatScrollRect = GetComponent<ScrollRect>();
        _voiceManager = VoiceManager.Instance;
        _networkManager = GameObject.Find("NetworkRoomManager").GetComponent<NetworkManagerHUDWBTB>();
        //if (_messageObjPool.Count > 0)
        //{

        //    ClearMessageObjectPool();
        //}
        ClearOutTextField();

        _voiceManager.OnParticipantAddedEvent += OnParticipantAdded;
        _voiceManager.OnTextMessageLogReceivedEvent += OnTextMessageLogReceivedEvent;

        EnterButton.onClick.AddListener(SubmitTextToVivox);
        MessageInputField.onEndEdit.AddListener((string text) => { EnterKeyOnTextField(); });

        if (_voiceManager.ActiveChannels.Count > 0)
        {
            _GameChannel = _voiceManager.ActiveChannels.FirstOrDefault(ac => ac.Channel.Name == _voiceManager.channelName).Key;
        }

        StartCoroutine(getPlayerManager());
        Debug.Log("textchat awake");
    }
Ejemplo n.º 5
0
    void Start()
    {
        //Sound Manager Singleton*************
        //make sure there is only ever one copy of this gameobject in existence
        if (aiInstance == null)
        {
            aiInstance = this;
        }
        else if (aiInstance != null)
        {
            Destroy(gameObject);
        }

        //persist througout the game
        DontDestroyOnLoad(aiInstance);
        //**************************************

        //make an array called sources for the AudioSource components
        AudioSource[] sources = GetComponents <AudioSource>();

        //for each in the sources array
        foreach (AudioSource source in sources)
        {
            //if the source is empty...
            if (source.clip == null)
            {
                //this is the audiosource we are looking for and we will call it soundEffectAudio
                voiceAudio = source;
            }
        }
    }
Ejemplo n.º 6
0
        private void toggleVoiceButton_Click(object sender, EventArgs e)
        {
            var voiceManager = new VoiceManager(ClsId);

            if (toggleVoiceButton.Text == "Show")
            {
                if (voicesToBeDeleted.Contains(_selectedVoice.Id))
                {
                    voicesToBeDeleted.Remove(_selectedVoice.Id);
                }

                if (!voiceManager.IsVoiceInstalled(_selectedVoice))
                {
                    voicesToBeAdded.Add(_selectedVoice.Id);
                }
                _selectedNode.Checked = true;
            }
            else
            {
                if (voicesToBeAdded.Contains(_selectedVoice.Id))
                {
                    voicesToBeAdded.Remove(_selectedVoice.Id);
                }

                if (voiceManager.IsVoiceInstalled(_selectedVoice))
                {
                    voicesToBeDeleted.Add(_selectedVoice.Id);
                }

                _selectedNode.Checked = false;
            }

            refreshToggleVoiceButton();
            refreshApplyButton();
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        public TestClient(ClientManager manager)
        {
            ClientManager = manager;

            updateTimer          = new System.Timers.Timer(500);
            updateTimer.Elapsed += new System.Timers.ElapsedEventHandler(updateTimer_Elapsed);

            RegisterAllCommands(Assembly.GetExecutingAssembly());

            Settings.LOG_LEVEL              = Helpers.LogLevel.Debug;
            Settings.LOG_RESENDS            = false;
            Settings.STORE_LAND_PATCHES     = true;
            Settings.ALWAYS_DECODE_OBJECTS  = true;
            Settings.ALWAYS_REQUEST_OBJECTS = true;
            Settings.SEND_AGENT_UPDATES     = true;
            Settings.USE_ASSET_CACHE        = true;

            Network.RegisterCallback(PacketType.AgentDataUpdate, AgentDataUpdateHandler);
            Network.LoginProgress     += LoginHandler;
            Objects.AvatarUpdate      += new EventHandler <AvatarUpdateEventArgs>(Objects_AvatarUpdate);
            Objects.TerseObjectUpdate += new EventHandler <TerseObjectUpdateEventArgs>(Objects_TerseObjectUpdate);
            Network.SimChanged        += new EventHandler <SimChangedEventArgs>(Network_SimChanged);
            Self.IM += Self_IM;
            Groups.GroupMembersReply         += GroupMembersHandler;
            Inventory.InventoryObjectOffered += Inventory_OnInventoryObjectReceived;

            Network.RegisterCallback(PacketType.AvatarAppearance, AvatarAppearanceHandler);
            Network.RegisterCallback(PacketType.AlertMessage, AlertMessageHandler);

            VoiceManager = new VoiceManager(this);

            updateTimer.Start();
        }
Ejemplo n.º 8
0
        /// <summary>
        ///
        /// </summary>
        public TestClient(ClientManager manager)
        {
            ClientManager = manager;

            updateTimer          = new System.Timers.Timer(500);
            updateTimer.Elapsed += new System.Timers.ElapsedEventHandler(updateTimer_Elapsed);

            RegisterAllCommands(Assembly.GetExecutingAssembly());

            Settings.LOG_LEVEL              = Helpers.LogLevel.Debug;
            Settings.LOG_RESENDS            = false;
            Settings.STORE_LAND_PATCHES     = true;
            Settings.ALWAYS_DECODE_OBJECTS  = true;
            Settings.ALWAYS_REQUEST_OBJECTS = true;
            Settings.SEND_AGENT_UPDATES     = true;
            Settings.USE_TEXTURE_CACHE      = true;

            Network.RegisterCallback(PacketType.AgentDataUpdate, new NetworkManager.PacketCallback(AgentDataUpdateHandler));
            Network.OnLogin           += new NetworkManager.LoginCallback(LoginHandler);
            Self.OnInstantMessage     += new AgentManager.InstantMessageCallback(Self_OnInstantMessage);
            Groups.OnGroupMembers     += new GroupManager.GroupMembersCallback(GroupMembersHandler);
            Inventory.OnObjectOffered += new InventoryManager.ObjectOfferedCallback(Inventory_OnInventoryObjectReceived);

            Network.RegisterCallback(PacketType.AvatarAppearance, new NetworkManager.PacketCallback(AvatarAppearanceHandler));
            Network.RegisterCallback(PacketType.AlertMessage, new NetworkManager.PacketCallback(AlertMessageHandler));

            VoiceManager = new VoiceManager(this);

            updateTimer.Start();
        }
Ejemplo n.º 9
0
    // Start is called before the first frame update
    void Start()
    {
        // Setup Singleton
        if (instance == null)
        {
            instance = this;
        }

        // Setup GrammarRecognizer
        grammarRecPas = new GrammarRecognizer(Path.Combine(Application.streamingAssetsPath, "PasswordGrammar.xml"), ConfidenceLevel.Low);
        Debug.Log("Grammar has Loaded!");
        grammarRecPas.OnPhraseRecognized += grammarRecPas_OnPhraseRecognized;
        grammarRecPas.Start();
        if (grammarRecPas.IsRunning)
        {
            Debug.Log("GrammerRecognizer is Running!");
        }

        // Setup GrammarRecognizer
        grammarRec = new GrammarRecognizer(Path.Combine(Application.streamingAssetsPath, "BasicGrammar.xml"), ConfidenceLevel.Low);
        Debug.Log("Password Grammar has Loaded!");
        grammarRec.OnPhraseRecognized += grammarRec_OnPhraseRecognized;
        grammarRec.Start();
        if (grammarRec.IsRunning)
        {
            Debug.Log("GrammerRecognizerPassword is Running!");
        }

        hasSaidPassword = false;
    }
Ejemplo n.º 10
0
    // Start is called before the first frame update
    private void Start()
    {
        vicDaichiSansho = VoiceManager.LoadAudioFile("Voice/Result/大地讃頌");

        voices = new VoiceCategory[path.Length];
        for (int i = 0; i < path.Length; i++)
        {
            voices[i].AudioFiles = VoiceManager.LoadAllAudioFile(path[i]);
        }
        //再生するボイスを切り分けるための飛距離カテゴリ設定
        voices[0].DistanceL = 0;
        voices[0].DistanceU = 40f;

        voices[1].DistanceL = 40f;
        voices[1].DistanceU = 80f;

        voices[2].DistanceL = 80f;
        voices[2].DistanceU = 100f;

        voices[3].DistanceL = 100f;
        voices[3].DistanceU = 140f;

        voices[4].DistanceL = 140f;
        voices[4].DistanceU = 10000f;
    }
Ejemplo n.º 11
0
    public Gcloud_TranslationVoice(VoiceManager manager, VoiceMode mode)
    {
        _Manager = manager;
        _Mode    = mode;

        FileIdDownloadingSet = new HashSet <string>();
    }
Ejemplo n.º 12
0
    private void Awake()
    {
        instance       = this;
        keywordActions = new Dictionary <string, UnityAction <string> >();

        var words = Alias.GetWords();

        foreach (var word in words)
        {
            AddKeyword(word);
        }

        /*// General
         * AddKeyword("para");
         * AddKeyword("esperen");
         *
         * // Spearmen
         * AddKeyword("lanceros");
         * AddKeyword("escudos");
         * AddKeyword("cúbranse");
         *
         * // Archers
         * AddKeyword("arqueros");
         * AddKeyword("apunten");
         * AddKeyword("fuego");
         * AddKeyword("disparen");*/

        keywordRecognizer = new KeywordRecognizer(keywordActions.Keys.ToArray());
        keywordRecognizer.OnPhraseRecognized += OnKeywordsRecognized;
        keywordRecognizer.Start();
    }
Ejemplo n.º 13
0
        async void HolographicSpace_CameraAdded(HolographicSpace sender, HolographicSpaceCameraAddedEventArgs args)
        {
            if (!appInited)
            {
                await window.Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
                {
                    SpatialMappingManager = new SpatialMappingManager();
                    VoiceManager          = new VoiceManager();

                    if (options == null)
                    {
                        options = new ApplicationOptions();
                    }

                    //override some options:
                    options.LimitFps = false;
                    options.Width    = (int)args.Camera.RenderTargetSize.Width;
                    options.Height   = (int)args.Camera.RenderTargetSize.Height;

                    Game = (StereoApplication)Activator.CreateInstance(holoAppType, options);
                    Game.Run();
                    GesturesManager = new GesturesManager(Game, ReferenceFrame);
                    AppStarted?.Invoke(Game);
                    appInited = true;
                });
            }
        }
Ejemplo n.º 14
0
        public LGVC_OffLineVoice(VoiceManager manager, VoiceMode mode)
        {
            _Manager = manager;
            _Mode    = mode;

            FileIdDownloadingSet = new HashSet <string>();
        }
Ejemplo n.º 15
0
 private void DisposeVoiceMgr()
 {
     if (voiceMgr != null)
     {
         voiceMgr.Dispose();
         voiceMgr = null;
     }
 }
Ejemplo n.º 16
0
 private void changeMicButton_Click(object sender, EventArgs e)
 {
     currentMicNumber = Int32.Parse(chosenMicDevice.Text);
     if (showMicDevice())
     {
         voiceMgr = VoiceManager.Reconfigure(voiceMgr, "connect_to_server false mic_device_number " + currentMicNumber, null);
     }
 }
Ejemplo n.º 17
0
    void Start()
    {
        // Set singleton reference
        VoiceManager.instance = this;

        // Instantiate dictionary for keywords
        keywords = new Dictionary <string, System.Action>();
    }
Ejemplo n.º 18
0
    public void Setup()
    {
        Music = new MusicManager();
        Voice = new VoiceManager();
        Noise = new NoiseManager();

        Reset();
    }
Ejemplo n.º 19
0
 private void getMicDevicesButton_Click(object sender, EventArgs e)
 {
     DisposeVoiceMgr();
     voiceMgr              = VoiceManager.Configure(null, null, "connect_to_server", false);
     microphoneDevices     = voiceMgr.GetAllMicrophoneDevices();
     deviceCountLabel.Text = "DeviceCount: " + microphoneDevices.Length;
     showMicDevice();
 }
Ejemplo n.º 20
0
 public MainPage()
 {
     this.speechManager = new SpeechManager();
     //this.movementManager = new EZBMovementManager();
     this.movementManager = new DebugMovementManager();
     this.reminderManager = new ReminderManager();
     this.voiceManager    = new VoiceManager();
     this.InitializeComponent();
 }
Ejemplo n.º 21
0
    public void UserSoundOn()
    {
        if (string.IsNullOrWhiteSpace(SoundIdInputField.text))
        {
            return;
        }

        VoiceManager.SoundOn(SoundIdInputField.text);
        SoundIdInputField.text = "";
    }
Ejemplo n.º 22
0
    void Start()
    {
        rootSettings = this.GetComponent <Fractals>();

        if (isHL)
        {
            voiceManager = this.GetComponent <VoiceManager>();
            voiceManager.OnVoiceCommand += VoiceManager_OnVoiceCommand;
        }
    }
Ejemplo n.º 23
0
	// Use this for initialization
	void Start () {
		if (singleton == null)
		{
			singleton = this;
		}
		else
		{
			Destroy(gameObject);
		}
	}
Ejemplo n.º 24
0
 public void SoundOnOff(bool isOn)
 {
     if (isOn)
     {
         VoiceManager.SoundOnAll();
     }
     else
     {
         VoiceManager.SoundOffAll();
     }
 }
Ejemplo n.º 25
0
 public void MicOnOff(bool isOn)
 {
     if (isOn)
     {
         VoiceManager.MicOn();
     }
     else
     {
         VoiceManager.MicOff();
     }
 }
Ejemplo n.º 26
0
 public void SetSoundOnOff(bool ison)
 {
     if (ison)
     {
         VoiceManager.SoundOn(playerid);
     }
     else
     {
         VoiceManager.SoundOff(playerid);
     }
 }
Ejemplo n.º 27
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 28
0
    private void Start()
    {
        _voiceManager = FindObjectOfType <VoiceManager>();

        _voiceStatus = _voiceManager.Init();

        if (_voiceStatus != 1)
        {
            _voiceName = _voiceManager.VoiceNames[1];
        }
    }
        ///<summary>
        ///    Used by the packet aggregator machinery
        ///</summary>
        public void WriteSubDataFrame(byte[] dataFrame)
        {
            int len = dataFrame.Length;

            if (len > 255)
            {
                log.ErrorFormat("VoiceMessage.WriteSubDataFrame: dataFrame len is {0}, for frame {1}",
                                len, VoiceManager.ByteArrayToHexString(dataFrame, 0, len));
            }
            writer.Write((byte)len);
            writer.Write(dataFrame, 0, len);
        }
Ejemplo n.º 30
0
 public CSVMsgData(int msgIdx_, MsgData msg)
 {
     msgIdx = msgIdx_;
     SetPositionRot(msg);
     mouseMoved  = GetMouseMoved(msg);
     talked      = DidTalk(msg);
     talkTimeSum = 0.0f;
     if (talked)
     {
         GetRelativeVolume(VoiceManager.GetVoicePacketFromMsg(SFSObject.NewFromBinaryData(new ByteArray(msg.msg))), out volume, out frequency, out minFrequency, out maxFrequency);
     }
 }
Ejemplo n.º 31
0
    private void Awake() // Lobby Scene으로 들어왔을때 제일 처음 실행.
    {
        //Debug.Log("room player awake");
        p1                = GameObject.Find("Player1Position").GetComponent <RectTransform>(); // 첫번째 플레이어 UI의 위치를 가져옴.
        _voiceManager     = VoiceManager.Instance;
        _voiceLogin       = GameObject.Find("voiceLogin").GetComponent <voiceLogin>();
        LobbySoundManager = GameObject.Find("LocalSoundManager");
        //playerNameList.Add(GameObject.Find("NetworkRoomManager").GetComponent<NetworkManagerHUDWBTB>().SetPlayerName);
        //CmdSetPlayerName(GameObject.Find("NetworkRoomManager").GetComponent<NetworkManagerHUDWBTB>().SetPlayerName);

        _voiceManager.OnParticipantAddedEvent += OnParticipantAdded;
    }
 ///<summary>
 ///    Constructor
 ///</summary>
 public BasicChannel(VoiceManager voiceMgr, bool recordingWAV, bool recordingSpeex, bool ambient)
     : base("", ambient)
 {
     this.voiceMgr = voiceMgr;
     // For VoiceChannels, these values will be overriden
     // by the codec definition.
     framesPerSecond = 50;
     samplesPerSecond = 8000;
     samplesPerFrame = samplesPerSecond / framesPerSecond;
     this.recordingWAV = recordingWAV;
     this.recordingSpeex = recordingSpeex;
 }
 ///<summary>
 ///    Constructor
 ///</summary>
 public MicrophoneChannel(VoiceManager voiceMgr, long playerOid, int deviceNumber, bool recordingWAV, bool recordingSpeex)
     : base(voiceMgr, recordingWAV, recordingSpeex, false)
 {
     ;
     // Will be used when we init the device
     micQueueSize = samplesPerFrame * 8;
     this.deviceNumber = deviceNumber;
     this.oid = playerOid;
     this.sourceActive = false;
     this.sourceReady = false;
     this.queuedSamples = new CircularBuffer(micQueueSize);
     this.title = "mic";
 }
 public DataFrameAggregator(VoiceManager voiceMgr, int deviceNumber, MicrophoneChannel micChannel)
 {
     this.voiceMgr = voiceMgr;
     this.deviceNumber = deviceNumber;
     this.micChannel = micChannel;
     this.pendingDataFrames = new List<byte[]>();
 }
 ///<summary>
 ///    The constructor creates the VoiceChannel object,
 ///    assigning it the external voiceNumber, and finally
 ///    activates the channel.
 ///</summary>
 public VoiceChannel(VoiceManager voiceMgr, long oid, byte voiceNumber, bool positionalSound, bool voicesRecordSpeex, VoiceParmSet parms)
     : base(voiceMgr, false, voicesRecordSpeex, !positionalSound)
 {
     this.oid = oid;
     this.positionalSound = positionalSound;
     this.voiceNumber = voiceNumber;
     this.channelCodec = new SpeexCodec();
     this.decodeBuffer = new short[playbackQueueSize];
     this.encodedBytes = new byte[maxBytesPerEncodedFrame];
     this.queuedSamples = new CircularBuffer(playbackQueueSize);
     this.voiceReadCallback = new FMOD.SOUND_PCMREADCALLBACK(VoiceChannelReadPCM);
     this.title = "voice" + voiceNumber;
     this.lastSpoke = 0;
     ActivateChannel();
     ApplyVoiceChannelParms(parms, false);
 }