Show / Hide Table of Contents

Interface INativeSourceSelector

An interface to use with GetNativeSourceAuto(INativeSourceSelector) You can implement your own logic that derives an index depending on some internal state.

Namespace: E7.Native
Assembly: E7.NativeAudio.dll
Syntax
public interface INativeSourceSelector
Remarks

You can for example create class MyKickDrumSelector : INativeSourceSelector and class MySnareSelector : INativeSourceSelector.

The target is that the kick is short, but often used. You want it to use native source index 0 exclusively. The snares keep using index 1 and 2 to not have to trouble the kick drum.

Code the logic such that :

  • The kick drum one keeps returning 0 in its NextNativeSourceIndex() implementation.
  • The snare one return 1 and 2 alternately on each NextNativeSourceIndex() call.

Methods

NextNativeSourceIndex()

Each call could return a different native source index by your own logic. Native Audio will call this once on each GetNativeSourceAuto(INativeSourceSelector)

If the returned int turns out to be an invalid index at native side, it has a fallback to round-robin native source selection.

Declaration
int NextNativeSourceIndex()
Returns
Type Description
System.Int32
In This Article
Back to top
A Unity plugin by 5argon from Exceed7 Experiments. Problems/suggestions/contact : 5argon@exceed7.com Discord Unity Forum