Search Unity

Audio Custom AudioEffect and 5.1 sound

Discussion in 'Audio & Video' started by JokerZ, Dec 7, 2018.

  1. JokerZ

    JokerZ

    Joined:
    May 16, 2014
    Posts:
    6
    Hello! I writing my own AudioEffect for unity AudioMixer and have some questions about audio workflow.

    Firstly, is it possible to use not stereo mode for sound hearing, but for example 5.1 mode and change it dynamicly? I can turn on different types through AudioSettings, but OnAudioFilterRead and method below show me that they content only 2 channels. (Even mixer show fill of soundbars only for two channels).

    Secondly, i have this function from AudioEffect plugin:

    Code (CSharp):
    1. UNITY_AUDIODSP_RESULT UNITY_AUDIODSP_CALLBACK ProcessCallback(
    2.         UnityAudioEffectState* state, float* inBuffer, float* outBuffer,
    3.         unsigned int length, int inChannels, int outChannels
    4.     )
    Which accept params like inChannels and outChannels. So i bothering is it possible to have different size of this channels, for ex. get audio from Unity in 5.1 mode (6 channels) from AudioMixer and return in stereo mode after my Effect processed.
     
  2. JokerZ

    JokerZ

    Joined:
    May 16, 2014
    Posts:
    6
    Can anyone just tell me if is it possible to "hear" audio at 5.1 mode (each of 5-6 channels has audio data spreaded from two channels) without 5.1 device connected?