Can you capture audio from Unity?

Is there a way to capture the audio from Unity into a file?

If you're trying to capture what the sound card outputs as you play the game, you can use Audacity on a PC or Wiretap on a Mac (Wiretap is trial-to-buy).

For Audacity (PC):

  1. Go to Preferences-->Audio I/O and set your input to the sound card you're using.
  2. In the top right of the main window, there's a drop-down menu that may say "Microphone," "Line In," or some other input type. Change this to "What U Hear."
  3. Hit record, hit stop when you're finished.
  4. Go to File-->Export to WAV to save the file.

For Wiretap (Mac):

  1. Go to Preferences-->Source and make sure that one of the Sources is set to "Mac Audio." (You can also set your recording destination and format here).
  2. Hit record, hit stop when you're finished.

Alternatively, on Mac OS 10.6 (Snow Leopard), you can use Quicktime X to do a screen capture and use an internal or external mic to record your speakers, though you'll get ambient room noise and computer hum as well.

NOTE: All these methods will record every sound your computer makes, so watch out for IM/Mail notifications and Mac volume adjustment blips.

The only existent method that Unity API is offering is this:

"EditorUtility.ExtractOggFile

static function ExtractOggFile (obj : Object, path : string) : bool

Description

Saves an AudioClip or MovieTexture to a file.

Will save an Ogg Vorbis or Ogg Theora file at the specified path. "

I never used it though, and I never seen it being used before. I hope it helps you. If you want to capture all the sound that you can hear at a specific time in Unity (e.g. multiple sounds playing at the same time) to a single audio file, I don't think there's any method of doing that.

You can use Soundflower (OS X, free) to route audio as you please. It's more complicated that Wiretap, because you need another app for recording, but it's free and has always worked perfectly for me.

I have never used Virtual Audio Cable, but it's apparently the Windows equivalent of Soundflower.

Also, Audacity runs on OS X, too, and would be an appropriate tool to use with either of these utilities, though it's redundant, given "What U Hear". Although I don't like Audacity, the tools I do like do not offer a simple "What U Hear" choice.

The fraps tool set captures audio and video from any running application, including a Unity game. It's very easy to set up and use.

for mac i can advise you Macvide ScreenCap (Play'n GO Casinos: Innovative games for quick profits - macvide.com), very easy and helpful progfor grabbing screen…

if the unity file is running inside a browser, the audio is not recorded no matter what software you try to use!!!

I have install Soundflower and the first time I tried to record the unity project using quicktime screenrecorder I got a large audio feed back loop and I have no idea how to stop the loop when recording , can anyone help please