Quantcast
Channel: Questions in topic: "count"
Viewing all articles
Browse latest Browse all 187

How I randomise a list of audio clips in Unity and remove it from the list once the clip is finished?

$
0
0
I have 4 audio clips. When I play a press a certain button in Unity, the data is sent to MAX/MSP and the audio is played. I created a list a signals (As shown below in the code). What I want is that, the signal list is randomised. The user presses a button to listen to the audio (which works fine). Once the clip is finished the user presses Next Trial button. Once the Next Trial is pressed. The previous clip is removed from the list. Once all the clips are finished. A message is displayed, in the Debug.Log("All trials finished"). I have the following problems: 1) One of the audio clips is repeated again. It appears that the audio clips are not removed from the list. 2) How do I write the audioclip index to a csv file? public class SignalToMax : MonoBehaviour { private static int localPort; private string IP; // define in init public int port = 8050; // define in init // "connection" things IPEndPoint remoteEndPoint; UdpClient client; // experiment case public string experimentCase = "A"; string strMessage = ""; public List signals; public static int stimIndex; } void Start() { NextTrial = GameObject.FindGameObjectWithTag("NextTrial").GetComponent

Viewing all articles
Browse latest Browse all 187

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>