Exemplo n.º 1
0
 public void Init(Client tclient, ClientCVar cvar)
 {
     if (Context != null)
     {
         Context.Dispose();
     }
     TheClient = tclient;
     CVars = cvar;
     Context = new AudioContext(AudioContext.DefaultDevice, 0, 0, false, true);
     Context.MakeCurrent();
     try
     {
         if (Microphone != null)
         {
             Microphone.StopEcho();
         }
         Microphone = new MicrophoneHandler(this);
     }
     catch (Exception ex)
     {
         SysConsole.Output("Loading microphone handling", ex);
     }
     if (Effects != null)
     {
         foreach (SoundEffect sfx in Effects.Values)
         {
             sfx.Internal = -2;
         }
     }
     Effects = new Dictionary<string, SoundEffect>();
     PlayingNow = new List<ActiveSound>();
     Noise = LoadSound(new DataStream(Convert.FromBase64String(NoiseDefault.NoiseB64)), "noise");
 }
Exemplo n.º 2
0
 // Desc: Create a new MicrophoneHandler and setup our RecordingFinished event.
 private void SetupMicrophone()
 {
     Debug.Log("Setup Mic");
     Debug.Log(Microphone.devices);
     mic = new MicrophoneHandler(Microphone.devices[0], MicrophoneHandler.SamplingRateEnum.SixteenK, maxRecordingTime);
     mic.RecordingFinished += ProcessAudio;
 }
Exemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        microphone  = this.GetComponent <MicrophoneHandler>();
        audioSource = GetComponent <AudioSource>();

        spectrum = new float[qSamples];
        fSample  = AudioSettings.outputSampleRate;
    }
Exemplo n.º 4
0
    IEnumerator startRecord()
    {
        yield return(new WaitForSeconds(0.2f));

        MicrophoneHandler.StartRecord();
        print("start Record");
        StartCoroutine(stopRecord());
    }
Exemplo n.º 5
0
    IEnumerator cutinAnimate()
    {
        yield return(new WaitForSeconds(1.5f));

        _playerObject.GetComponentInChildren <PlayerControl>().fallLock = 0f;
        animateScene.SetActive(true);
        MicrophoneHandler.ReplayRecord();
        StartCoroutine(showHeightText());
    }
Exemplo n.º 6
0
    void playerJump()
    {
        print("playerJump");

        Global.gameStatu = Global.GameStatu.Jumping;
        _playerObject.GetComponentInChildren <PlayerControl>().makeHeJump(Global.ratio * 2f);
        MicrophoneHandler.ReplayRecord();
        StartCoroutine(cutinAnimate());
    }
Exemplo n.º 7
0
    IEnumerator stopRecord()
    {
        yield return(new WaitForSeconds(1.5f));

        startButton.gameObject.SetActive(false);
        MicrophoneHandler.StopRecord();
        Global.ratio = MicrophoneHandler.GetHighestRatio() * 1.4f;
        print("stop Record + " + Global.ratio);
        playerJump();
    }
Exemplo n.º 8
0
 private Service(MainWindow observer)
 {
     this.observer        = observer;
     microphones          = new MicrophoneHandler(this);
     WMHandler            = new WiimoteHandler();
     stimuly_data_context = MovementWindowViewModel.GetInstance();
     wm1_data_context     = new WiimoteDataContext();
     wm2_data_context     = new WiimoteDataContext();
     mic_data_context     = new MicrophoneViewModel();
     try {
         port = PortAccessHandler.GetIntance();
     }
     catch (Exception ex)
     {
         Xceed.Wpf.Toolkit.MessageBox.Show(
             "A paralel port could not be detected on the given address. Please make sure you have a paralel port on the machine. \r\n" +
             ex.Message);
         port = null;
     }
 }
 void Awake()
 {
     AirConsole.instance.onMessage += OnMessage;
     objectMotions     = GetComponent <ObjectMotions>();
     microphoneHandler = GetComponent <MicrophoneHandler>();
 }