Set audio clip to 3D in script

Hi, I have been breaking my head over this one for a couple of day’s now and I can’t seem to find a direct answer on the wiki/questions/forums to my problem.

It is about the following piece of code. audio.clip = Microphone.Start(selectedDevice, true, 10, maxFreq);

As you can see it is an audio clip created directly in script. What I need is that this audio clip gets imported as a 3D sound, which can not be done in the editor, since there is not physical clip in my asset folder (because I create it live in my script).

Is there anyway I can set it’s audio type manually without using the AssetImporter class (because this would require a datapath to a clip inside the asset folder).

There’s no way to set it directly. As with sprites (and their importer settings) You have to set them via the Create function.

Create a new audio clip with the settings you want, GetData from your microphone recording and SetData on your new audio clip.