Hi! I am new to Sonic Pi so maybe this is a really simple answer but I can’t figure it out by googling or in any other threads. I want to get a live audio input either from a USB mic or the computer’s microphone. I read the Sonic Pi manual for this section and it seems pretty straightforward how to test it (multichannel audio 13.2 live audio). When I run the test code the log says that it’s using supercollider as an audio server but the time never increases. Am I missing a parameter or is the problem in my mac’s sound-card…in the system preferences> sound> input, the internal mic is selected.
=> Starting run 4
{run: 4, time: 0.0}
└─ live_audio :foo, {}
=> Stopping all runs…
=> Stopping run 4
=> Completed run 4
=> All runs completed
=> Pausing SuperCollider Audio Server
why is the time not running and what is the empty array after the name?
Hello @LambKebab 
Off the top of my head, I can at least answer your first question. Time is appearing to not advance because by itself, :live_audio
does nothing to advance the time in any thread or loop that it might sit within. (Just as playing a sample, or a synth, without having any calls to sleep
or sync
will also not advance the time). Since nothing has told Sonic Pi to sleep/wait, the (virtual) time doesn’t progress.
Does that make sense at all?
As to the empty hash after the name, I don’t remember at the moment, but @samaaron or someone else might be able to shed light on it 
1 Like
Thank you, it does make sense. I just still can’t figure out how to make it make any sound. In the manual there’ a thread given to test the computer’s internal mic… (which in system preference is picking up sound)
with_fx :reverb do
live_audio :foo
end
So I guess more specifically my question is why is SP not picking up the first input of my sound card and how do I double-check that for mac (it’s selected in system preferences as input but maybe there’s another step). I saw another thread with the same question but also no answer.
Which version of MacOS are you using?
It may be that you need to go to System Preferences->Security & Privacy and enable Sonic Pi to have access to your microphone.
I am currently using SP 3.3beta and here is the adjustment on Catalina

Otherwise, make sure that the mic is your default input BEFORE launching Sonic Pi (you can check this in Audio-MIDI setup in the Audio Devices window, and then a simple one-liner program like
live_audio :foo
should work. (Beware of feedback via your speakers)
1 Like