Hi @Adzo94. You need to attach the microphone to the AudioSource. I don’t think you can do this through the GUI so you’ll need to add a script to the same GameObject the CsoundUnity script is attached to. Something like this does the trick for me:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start ()
{
foreach (var device in Microphone.devices)
{
Debug.Log("Name: " + device);
}
AudioSource audioSource = GetComponent<AudioSource>();
audioSource.clip = Microphone.Start("Microphone Array (Realtek High Definition Audio)", true, 10, 44100);
audioSource.Play();
}
// Update is called once per frame
void Update () {
}
}
My Csound file then looks like this:
<Cabbage>
form caption("Test"), size(300, 200)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -m0d
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1
instr TEST
a1 inch 1
outs a1, a1
endin
</CsInstruments>
<CsScore>
i"TEST" 0 z
</CsScore>
</CsoundSynthesizer>