Package ej.audio.sink

Class MockAudioSinkFactory

java.lang.Object
ej.audio.sink.MockAudioSinkFactory

public class MockAudioSinkFactory extends Object
This factory instantiates the implementation of MockAudioSink to use in this mock.

By default, it loads an instance of MockDefaultAudioSink, but the class to load can be changed by setting the system property "microej.internal.mock.audio.sink.impl" with the fully qualified name of the alternative implementation. This other implementation can be loaded from another mock which is loaded in the same VEE.

See Also:
  • Field Details

    • MOCK_AUDIO_SINK_IMPL

      public static final String MOCK_AUDIO_SINK_IMPL
      The system property used to override the default audio sink loaded by the audio mock.

      The value must be the fully qualified name of an implementation of MockAudioSink. If the system property is not set, or its value does not correspond to a valid fully qualified name of a subclass of MockAudioSink, it loads an instance of MockDefaultAudioSink.

      To load a subclass of MockAudioSink from another mock, the other mock must have this mock in its compile classpath. You can then implement MockAudioSink and set it as audio sink implementation to use by calling System.setProperty(MockAudioSinkFactory.MOCK_AUDIO_SINK_IMPL, <CUSTOM_AUDIOSINK_FQN>) where <CUSTOM_AUDIOSINK_FQN> is the fully qualified name of your custom implementation.

      See Also:
  • Method Details

    • getInstance

      public static MockAudioSink getInstance(int resourceId, byte[] formatEncoding, int[] formatParameters, int bufferSize) throws ej.sni.NativeIOException
      Throws:
      ej.sni.NativeIOException