- Home /
Recording audio in Unity (NOT by microphone)
I'm trying to build a music-creation app. Right now I can trigger sounds on different events through an audio source.
My question is, how can I start recording the exact sequence of sounds played by that audio source whenever I trigger a "record" event, and stop when I trigger that event again?
I am doing the same thing, did u ever figure it out. I used an arraylist and added notes pressed to the list and played them but it doesn't work as i want it to
https://docs.unity3d.com/ScriptReference/$$anonymous$$onoBehaviour.OnAudioFilterRead.html
Before going from audiosource to output, sound is passed as a float array through OnAudioFilterRead if it is implemented. If you concatenate that array in a buffer of yours, you can later set that buffer to an AudioClip and play it (you have to adjust some parameters, or the sound will be choppy) using https://docs.unity3d.com/ScriptReference/AudioClip.SetData.html
Problem is, the sound is uncompressed (doh), so it takes a lot of space. I was thinking of buffering each 4/8/16th element ins$$anonymous$$d of copying the whole data array and adjusting the play parameters accordingly.
Would u by chance have a script, Im new to program$$anonymous$$g and I can't figure out how to record
Your answer
![](https://koobas.hobune.stream/wayback/20220612154650im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Microphone capture different channels 0 Answers
Recording audio from another audio source 1 Answer
AudioHighPassFilter with multiple AudioSource 1 Answer
Guys i need help with audio! 0 Answers
Global audio option 2 Answers