示例#1
0
 public void OnEndRecord()
 {
     if (fileSlot == null)
     {
         fileSlot = GameObject.Find("FileSlot(Clone)").GetComponent <FileSlot>();
     }
     fileSlot.EncodeWavFile(s.clipName);
 }
示例#2
0
 void Start()
 {
     fileSlot       = null;
     networkAddress = "192.168.219.118";
     s = GameObject.Find("RecordManager").GetComponent <SoundRecorder>();
     // OpenServer();
     ConnectClientToServer();
 }
示例#3
0
 public void OnSendToHost()
 {
     if (fileSlot == null)
     {
         fileSlot = GameObject.Find("FileSlot(Clone)").GetComponent <FileSlot>();
     }
     Debug.Log("[Client]OnSendToHost.");
     StartCoroutine(fileSlot.UploadWavCoroutine(true));
     Debug.Log("[Client]OnSendToHost Finished.");
 }
示例#4
0
    public void OnEndEdit()
    {
        if (fileSlot == null)
        {
            fileSlot = GameObject.Find("FileSlot(Clone)").GetComponent <FileSlot>();
        }

        inputText          = inputTxtField.text;
        inputTxtField.text = "";

        fileSlot.EncodeTextFile(inputText);
        fileSlot.CmdUploadTxt(fileSlot.txtFileData);
        SetLoadingImageEnabled(true);
    }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     fileSlot            = null;
     fileType            = FileType.Text;
     exceptionText       = GameObject.Find("SocketExceptionText").GetComponent <Text>();
     exceptionText.text  = "";
     clientInfoText      = GameObject.Find("ClientInfoText").GetComponent <Text>();
     clientInfoText.text = "";
     logText             = GameObject.Find("LogText").GetComponent <Text>();
     logText.text        = "";
     togglegroup         = GameObject.Find("ToggleGroup").GetComponent <ToggleGroup>();
     inputAddressField   = GameObject.Find("AddressInputField").GetComponent <InputField>();
     inputMessageField   = GameObject.Find("MessageInputField").GetComponent <InputField>();
 }
示例#6
0
    private IEnumerator GetTxt_SendWav_Routine(FileSlot fileSlot)
    {
        while (true)
        {
            if (File.Exists(Path.Combine(dataPath, "result.wav")))
            {
                break;
            }
            Debug.Log(File.Exists(Path.Combine(dataPath, "result.wav")));
            yield return(null);
        }

        yield return(StartCoroutine(fileSlot.WavEncodingCoroutine("result")));

        yield return(StartCoroutine(fileSlot.UploadWavCoroutine(false)));
    }
示例#7
0
    public void OnSendToHost()
    {
        if (fileSlot == null)
        {
            fileSlot = GameObject.Find("FileSlot(Clone)").GetComponent <FileSlot>();
        }

        if (fileType == FileType.Text)
        {
            fileSlot.CmdUploadTxt(fileSlot.txtFileData);
        }
        else if (fileType == FileType.Wav)
        {
            StartCoroutine(fileSlot.UploadWavCoroutine(true));
        }
    }
示例#8
0
    public void OnEnroll()
    {
        if (fileSlot == null)
        {
            fileSlot = GameObject.Find("FileSlot(Clone)").GetComponent <FileSlot>();
        }

        if (fileType == FileType.Text)
        {
            fileSlot.EncodeTextFile(inputMessage);
        }
        else if (fileType == FileType.Wav)
        {
            fileSlot.EncodeWavFile(inputMessage);
        }
    }
示例#9
0
 public void OnTextRecieved(FileSlot fileSlot, string content)
 {
     StartCoroutine(GetTxt_SendWav_Routine(fileSlot));
 }