private void InitSamplePopups(int index, WaveFileObject[] wavs)
    {
        WaveFileObject[] waves = wavs[index].ToWaveChunks(500, wavs[index]);

        Debug.Log("Number of Chunks: " + waves.Length);

        string folderName   = baseSamplePath + "/Sample_" + index;
        string resourcePath = "SoundSamples" + "/Sample_" + index;

        Directory.CreateDirectory(folderName);

        for (int i = 0; i < waves.Length; i++)
        {
            WriteWaveFile(waves[i], folderName + "/soundSample" + i + ".wav");
            string path = resourcePath + "/soundSample" + i;

            Debug.Log("Waiting for client to connect");
            while (server.clientReady != true)
            {
            }

            WFOTransporter transporter = new WFOTransporter(waves[i]);

            string json = JsonUtility.ToJson(transporter);
            server.SendMsg(json);

            Debug.Log("Waiting for client to Respond");
            while (server.jsonResult == "")
            {
            }
            Debug.Log("Response from client");

            DataSample sample = JsonUtility.FromJson <DataSample>(server.jsonResult);
            server.jsonResult = "";

            SamplePopData samplePop = new SamplePopData(sample, path, waves[i]);

            samplePopList.Add(samplePop);
            Debug.Log("Sample " + i + " Initialized");
        }
    }
Ejemplo n.º 2
0
 public void Init(SamplePopData sample)
 {
     popData = sample;
 }