コード例 #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());
    }
コード例 #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();
    }
コード例 #3
0
ファイル: DemoSocialManager.cs プロジェクト: niceoasi/Unity
    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");
    }
コード例 #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");
    }
コード例 #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;
            }
        }
    }
コード例 #6
0
ファイル: Form1.cs プロジェクト: troylar/aws-configurator
        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();
        }
コード例 #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();
        }
コード例 #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();
        }
コード例 #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;
    }
コード例 #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;
    }
コード例 #11
0
    public Gcloud_TranslationVoice(VoiceManager manager, VoiceMode mode)
    {
        _Manager = manager;
        _Mode    = mode;

        FileIdDownloadingSet = new HashSet <string>();
    }
コード例 #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();
    }
コード例 #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;
                });
            }
        }
コード例 #14
0
        public LGVC_OffLineVoice(VoiceManager manager, VoiceMode mode)
        {
            _Manager = manager;
            _Mode    = mode;

            FileIdDownloadingSet = new HashSet <string>();
        }
コード例 #15
0
 private void DisposeVoiceMgr()
 {
     if (voiceMgr != null)
     {
         voiceMgr.Dispose();
         voiceMgr = null;
     }
 }
コード例 #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);
     }
 }
コード例 #17
0
    void Start()
    {
        // Set singleton reference
        VoiceManager.instance = this;

        // Instantiate dictionary for keywords
        keywords = new Dictionary <string, System.Action>();
    }
コード例 #18
0
ファイル: AudioManager.cs プロジェクト: MrHungerrr/EXaM
    public void Setup()
    {
        Music = new MusicManager();
        Voice = new VoiceManager();
        Noise = new NoiseManager();

        Reset();
    }
コード例 #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();
 }
コード例 #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();
 }
コード例 #21
0
    public void UserSoundOn()
    {
        if (string.IsNullOrWhiteSpace(SoundIdInputField.text))
        {
            return;
        }

        VoiceManager.SoundOn(SoundIdInputField.text);
        SoundIdInputField.text = "";
    }
コード例 #22
0
    void Start()
    {
        rootSettings = this.GetComponent <Fractals>();

        if (isHL)
        {
            voiceManager = this.GetComponent <VoiceManager>();
            voiceManager.OnVoiceCommand += VoiceManager_OnVoiceCommand;
        }
    }
コード例 #23
0
ファイル: VoiceManager.cs プロジェクト: se210/AbulaHoosh
	// Use this for initialization
	void Start () {
		if (singleton == null)
		{
			singleton = this;
		}
		else
		{
			Destroy(gameObject);
		}
	}
コード例 #24
0
 public void SoundOnOff(bool isOn)
 {
     if (isOn)
     {
         VoiceManager.SoundOnAll();
     }
     else
     {
         VoiceManager.SoundOffAll();
     }
 }
コード例 #25
0
 public void MicOnOff(bool isOn)
 {
     if (isOn)
     {
         VoiceManager.MicOn();
     }
     else
     {
         VoiceManager.MicOff();
     }
 }
コード例 #26
0
 public void SetSoundOnOff(bool ison)
 {
     if (ison)
     {
         VoiceManager.SoundOn(playerid);
     }
     else
     {
         VoiceManager.SoundOff(playerid);
     }
 }
コード例 #27
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else if (Instance != this)
     {
         Destroy(gameObject);
     }
 }
コード例 #28
0
    private void Start()
    {
        _voiceManager = FindObjectOfType <VoiceManager>();

        _voiceStatus = _voiceManager.Init();

        if (_voiceStatus != 1)
        {
            _voiceName = _voiceManager.VoiceNames[1];
        }
    }
コード例 #29
0
        ///<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);
        }
コード例 #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);
     }
 }
コード例 #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;
    }
コード例 #32
0
 ///<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;
 }
コード例 #33
0
 ///<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";
 }
コード例 #34
0
 public DataFrameAggregator(VoiceManager voiceMgr, int deviceNumber, MicrophoneChannel micChannel)
 {
     this.voiceMgr = voiceMgr;
     this.deviceNumber = deviceNumber;
     this.micChannel = micChannel;
     this.pendingDataFrames = new List<byte[]>();
 }
コード例 #35
0
 ///<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);
 }