com.google.android.exoplayer2.audio.AudioCapabilities Java Examples
The following examples show how to use
com.google.android.exoplayer2.audio.AudioCapabilities.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RendererProvider.java From ExoMedia with Apache License 2.0 | 6 votes |
@NonNull protected List<Renderer> buildAudioRenderers() { List<Renderer> renderers = new ArrayList<>(); renderers.add(new MediaCodecAudioRenderer(context, MediaCodecSelector.DEFAULT, drmSessionManager, true, handler, audioRendererEventListener, AudioCapabilities.getCapabilities(context))); // Adds any registered classes List<String> classNames = ExoMedia.Data.registeredRendererClasses.get(ExoMedia.RendererType.AUDIO); if (classNames != null) { for (String className: classNames) { try { Class<?> clazz = Class.forName(className); Constructor<?> constructor = clazz.getConstructor(Handler.class, AudioRendererEventListener.class); Renderer renderer = (Renderer) constructor.newInstance(handler, audioRendererEventListener); renderers.add(renderer); } catch (Exception e) { // Purposefully left blank } } } return renderers; }
Example #2
Source File: SonicMediaCodecAudioRenderer.java From K-Sonic with MIT License | 5 votes |
public SonicMediaCodecAudioRenderer(MediaCodecSelector mediaCodecSelector, DrmSessionManager<FrameworkMediaCrypto> drmSessionManager, boolean playClearSamplesWithoutKeys, Handler eventHandler, AudioRendererEventListener eventListener, AudioCapabilities audioCapabilities, AudioProcessor... audioProcessors) { super(mediaCodecSelector, drmSessionManager, playClearSamplesWithoutKeys, eventHandler, eventListener, audioCapabilities, audioProcessors); //Init bufferIndex = -1; speed = 1.0f; pitch = 1.0f; rate = 1.0f; }