Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Possible to access the internal FMOD instance either in Unity or native-side (iOS / obj-c) ?

Discussion in 'Audio & Video' started by Iamdain, Jun 28, 2015.

  1. Iamdain

    Iamdain

    Joined:
    Feb 3, 2010
    Posts:
    90
    The plugin for the full 'FMOD Studio' seems to have a public handle to it's instance but does anyone know if there's any way to access the FMOD object (singleton or however it's structured) in the regular FMOD built into Unity?

    Background:
    I'd like to save game audio in realtime and synch it up with an AVAssetwriter video recording of gameplay which is done in native iOS code, ultimately creating a screen capture with sound of the Unity scene. So I need access to the stream of audio data, I see that FMOD allows access to output buffers so I thought that would be a good place to try and hook in but there's seemingly very little that's publicly exposed of the FMOD system in Unity and I can't find anything helpful in docs or online.

    Alternatively, I'm not sure how the whole system is wrapped up in iOS, I would think using AudioUnits or an AUGraph, but maybe there's some way to get a reference to and read out of whatever Obj-c class is being utilised to run the FMOD system. AudioUnits allow access to live buffer data too so that could work.

    Backup would be to stream the data from the AudioFilter in Unity either to file or passing through to Obj-c on the fly but would be a bit more work. Hoping there's a way to get at the audio stream directly from Xcode...