Record Audio Onset

137 views
Skip to first unread message

zhehao

unread,
Oct 7, 2021, 8:43:39 AM10/7/21
to Bonsai Users
Hi,

I am using Bonsai for Fiber Photometry (FP). I would like to present a lot of different audio stimuli (using labview) to animals while recording the FP signals. So I need to know when and what the audio signal is presented.  What I am thinking about now is to split audio output into two. One gose to the speaker, another one goes to the audio interface (connected with the PC). Then how can I use Bonsai to acquire the signals received by the audio interface and sync the time with the FP signal ?

Or is there any other way that I can directly send audio signal to Bonsai directly from labview?

Thank you so much!

Zhehao

brunocruz

unread,
Oct 7, 2021, 12:58:06 PM10/7/21
to Bonsai Users
Hi Zhehao,

By audio interface do you mean microphone? If that is the case I am afraid it wont solve your problem, since it wont guarantee that the mic input is synced with your fiber photometry acquisition system. Does your fiber photometry setup support some sort of extra analog input that you could use to record your audio signal? 

cheers
Bruno

zhehao

unread,
Oct 8, 2021, 2:06:18 AM10/8/21
to Bonsai Users
Hi Bruno,

There is an analog input port in the fiber photometry acquisition system. Maybe I can use it for synchronization. Then I was wondering how should I code it in Bonsai? Maybe Analog-Input module for Ardunio ( the system is ardunio based) ?

Zhehao

brunocruz

unread,
Oct 8, 2021, 2:31:09 AM10/8/21
to Bonsai Users
Hi Zhehao,

What is the system you are currently using?

B

zhehao

unread,
Oct 8, 2021, 2:44:31 AM10/8/21
to Bonsai Users
Hi Bruno,

Neurophotometrics FP3001 is the acquisition system I am using.

Zhehao

brunocruz

unread,
Oct 8, 2021, 3:10:38 AM10/8/21
to Bonsai Users
I am, unfortunately, not familiar with that acquisition system so I am afraid I won't be of much help... I hope someone else is able to help you out!

zhehao

unread,
Oct 8, 2021, 3:24:31 AM10/8/21
to Bonsai Users
No worries, thank you for your help! By the way, I have just posted another post about package installation. I was wondering if you have ideas about it.

Gonçalo Lopes

unread,
Dec 29, 2021, 7:45:00 PM12/29/21
to zhehao, Bonsai Users
Hi Zhehao,

I believe the FP3001 auxiliary BNC is more for TTL triggering of frames, or for outputting a sync signal, I'm not aware that you can use it as an analog input port. However, going back to your original idea of synching audio in the computer, latencies might be in the order of 10ms but this might be good enough for photometry signals.

You can use the AudioCapture source to grab audio data from either a microphone or line-in input in the soundcard and then combine it with photometry data using CombineLatest or WithLatestFrom. You would need to decide in which format you would like to see the data synchronised, either marking the audio stimulus data with photometry, or the opposite, label the photometry frame with whether there was an onset of a stimulus in that frame.


--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/5b7c293f-f9f5-4652-a4d3-f929f63dc7dbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages