mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
1315 lines
73 KiB
HTML
1315 lines
73 KiB
HTML
<!DOCTYPE HTML>
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet -->
|
|
<title>DefaultAudioSink (ExoPlayer library)</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
|
|
<script type="text/javascript" src="../../../../../script.js"></script>
|
|
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
|
|
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
|
|
<!--[if IE]>
|
|
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
|
|
<![endif]-->
|
|
<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script>
|
|
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="DefaultAudioSink (ExoPlayer library)";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10};
|
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
|
|
var altColor = "altColor";
|
|
var rowColor = "rowColor";
|
|
var tableTab = "tableTab";
|
|
var activeTableTab = "activeTableTab";
|
|
var pathtoroot = "../../../../../";
|
|
var useModuleDirectories = false;
|
|
loadScripts(document, 'script');</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<header role="banner">
|
|
<nav role="navigation">
|
|
<div class="fixedNav">
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a id="navbar.top">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a id="navbar.top.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../../../index.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../../../index-all.html">Index</a></li>
|
|
<li><a href="../../../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../../../allclasses.html">All Classes</a></li>
|
|
</ul>
|
|
<ul class="navListSearch">
|
|
<li><label for="search">SEARCH:</label>
|
|
<input type="text" id="search" value="search" disabled="disabled">
|
|
<input type="reset" id="reset" value="reset" disabled="disabled">
|
|
</li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
|
<li><a href="#field.summary">Field</a> | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field.detail">Field</a> | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a id="skip.navbar.top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
</div>
|
|
<div class="navPadding"> </div>
|
|
<script type="text/javascript"><!--
|
|
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
|
|
//-->
|
|
</script>
|
|
</nav>
|
|
</header>
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<main role="main">
|
|
<div class="header">
|
|
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">com.google.android.exoplayer2.audio</a></div>
|
|
<h2 title="Class DefaultAudioSink" class="title">Class DefaultAudioSink</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li><a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">java.lang.Object</a></li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>com.google.android.exoplayer2.audio.DefaultAudioSink</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<dl>
|
|
<dt>All Implemented Interfaces:</dt>
|
|
<dd><code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
<hr>
|
|
<pre>public final class <span class="typeNameLabel">DefaultAudioSink</span>
|
|
extends <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>
|
|
implements <a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></pre>
|
|
<div class="block">Plays audio data. The implementation delegates to an <a href="https://developer.android.com/reference/android/media/AudioTrack.html" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack</code></a> and handles playback
|
|
position smoothing, non-blocking writes and reconfiguration.
|
|
|
|
<p>If tunneling mode is enabled, care must be taken that audio processors do not output buffers
|
|
with a different duration than their input, and buffer processors must produce output
|
|
corresponding to their last input immediately after that input is queued. This means that, for
|
|
example, speed adjustment is not possible while using tunneling.</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="nested.class.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Nested Class Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colSecond" scope="col">Class</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static interface </code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DefaultAudioSink.AudioProcessorChain.html" title="interface in com.google.android.exoplayer2.audio">DefaultAudioSink.AudioProcessorChain</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Provides a chain of audio processors, which are used for any user-defined processing and
|
|
applying playback parameters (if supported).</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DefaultAudioSink.DefaultAudioProcessorChain.html" title="class in com.google.android.exoplayer2.audio">DefaultAudioSink.DefaultAudioProcessorChain</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The default audio processor chain, which applies a (possibly empty) chain of user-defined audio
|
|
processors followed by <a href="SilenceSkippingAudioProcessor.html" title="class in com.google.android.exoplayer2.audio"><code>SilenceSkippingAudioProcessor</code></a> and <a href="SonicAudioProcessor.html" title="class in com.google.android.exoplayer2.audio"><code>SonicAudioProcessor</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DefaultAudioSink.InvalidAudioTrackTimestampException.html" title="class in com.google.android.exoplayer2.audio">DefaultAudioSink.InvalidAudioTrackTimestampException</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Thrown when the audio track has provided a spurious timestamp, if <a href="#failOnSpuriousAudioTimestamp"><code>failOnSpuriousAudioTimestamp</code></a> is set.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static interface </code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="DefaultAudioSink.OffloadMode.html" title="annotation in com.google.android.exoplayer2.audio">DefaultAudioSink.OffloadMode</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Audio offload mode configuration.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="nested.classes.inherited.from.class.com.google.android.exoplayer2.audio.AudioSink">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Nested classes/interfaces inherited from interface com.google.android.exoplayer2.audio.<a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></h3>
|
|
<code><a href="AudioSink.ConfigurationException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.ConfigurationException</a>, <a href="AudioSink.InitializationException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.InitializationException</a>, <a href="AudioSink.Listener.html" title="interface in com.google.android.exoplayer2.audio">AudioSink.Listener</a>, <a href="AudioSink.SinkFormatSupport.html" title="annotation in com.google.android.exoplayer2.audio">AudioSink.SinkFormatSupport</a>, <a href="AudioSink.UnexpectedDiscontinuityException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.UnexpectedDiscontinuityException</a>, <a href="AudioSink.WriteException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.WriteException</a></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- =========== FIELD SUMMARY =========== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="field.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Field Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colSecond" scope="col">Field</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static float</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT_PLAYBACK_SPEED">DEFAULT_PLAYBACK_SPEED</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The default playback speed.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#failOnSpuriousAudioTimestamp">failOnSpuriousAudioTimestamp</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">Whether to throw an <a href="DefaultAudioSink.InvalidAudioTrackTimestampException.html" title="class in com.google.android.exoplayer2.audio"><code>DefaultAudioSink.InvalidAudioTrackTimestampException</code></a> when a spurious timestamp is
|
|
reported from <a href="https://developer.android.com/reference/android/media/AudioTrack.html#getTimestamp(android.media.AudioTimestamp)" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack.getTimestamp(android.media.AudioTimestamp)</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static float</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MAX_PITCH">MAX_PITCH</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The maximum allowed pitch factor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static float</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MAX_PLAYBACK_SPEED">MAX_PLAYBACK_SPEED</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The maximum allowed playback speed.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static float</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MIN_PITCH">MIN_PITCH</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The minimum allowed pitch factor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static float</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MIN_PLAYBACK_SPEED">MIN_PLAYBACK_SPEED</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The minimum allowed playback speed.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OFFLOAD_MODE_DISABLED">OFFLOAD_MODE_DISABLED</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The audio sink will never play in offload mode.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OFFLOAD_MODE_ENABLED_GAPLESS_NOT_REQUIRED">OFFLOAD_MODE_ENABLED_GAPLESS_NOT_REQUIRED</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The audio sink will prefer offload playback even if this might result in silence gaps between
|
|
tracks.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED">OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED</a></span></code></th>
|
|
<td class="colLast">
|
|
<div class="block">The audio sink will prefer offload playback except if the track is gapless and the device does
|
|
not advertise support for gapless playback in offload.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="fields.inherited.from.class.com.google.android.exoplayer2.audio.AudioSink">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Fields inherited from interface com.google.android.exoplayer2.audio.<a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></h3>
|
|
<code><a href="AudioSink.html#CURRENT_POSITION_NOT_SET">CURRENT_POSITION_NOT_SET</a>, <a href="AudioSink.html#SINK_FORMAT_SUPPORTED_DIRECTLY">SINK_FORMAT_SUPPORTED_DIRECTLY</a>, <a href="AudioSink.html#SINK_FORMAT_SUPPORTED_WITH_TRANSCODING">SINK_FORMAT_SUPPORTED_WITH_TRANSCODING</a>, <a href="AudioSink.html#SINK_FORMAT_UNSUPPORTED">SINK_FORMAT_UNSUPPORTED</a></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="constructor.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Constructor</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(com.google.android.exoplayer2.audio.AudioCapabilities,com.google.android.exoplayer2.audio.AudioProcessor%5B%5D)">DefaultAudioSink</a></span>​(<a href="AudioCapabilities.html" title="class in com.google.android.exoplayer2.audio">AudioCapabilities</a> audioCapabilities,
|
|
<a href="AudioProcessor.html" title="interface in com.google.android.exoplayer2.audio">AudioProcessor</a>[] audioProcessors)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Creates a new default audio sink.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(com.google.android.exoplayer2.audio.AudioCapabilities,com.google.android.exoplayer2.audio.AudioProcessor%5B%5D,boolean)">DefaultAudioSink</a></span>​(<a href="AudioCapabilities.html" title="class in com.google.android.exoplayer2.audio">AudioCapabilities</a> audioCapabilities,
|
|
<a href="AudioProcessor.html" title="interface in com.google.android.exoplayer2.audio">AudioProcessor</a>[] audioProcessors,
|
|
boolean enableFloatOutput)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Creates a new default audio sink, optionally using float output for high resolution PCM.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(com.google.android.exoplayer2.audio.AudioCapabilities,com.google.android.exoplayer2.audio.DefaultAudioSink.AudioProcessorChain,boolean,boolean,int)">DefaultAudioSink</a></span>​(<a href="AudioCapabilities.html" title="class in com.google.android.exoplayer2.audio">AudioCapabilities</a> audioCapabilities,
|
|
<a href="DefaultAudioSink.AudioProcessorChain.html" title="interface in com.google.android.exoplayer2.audio">DefaultAudioSink.AudioProcessorChain</a> audioProcessorChain,
|
|
boolean enableFloatOutput,
|
|
boolean enableAudioTrackPlaybackParams,
|
|
int offloadMode)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Creates a new default audio sink, optionally using float output for high resolution PCM and
|
|
with the specified <code>audioProcessorChain</code>.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="method.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="memberSummary">
|
|
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colSecond" scope="col">Method</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr id="i0" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#configure(com.google.android.exoplayer2.Format,int,int%5B%5D)">configure</a></span>​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> inputFormat,
|
|
int specifiedBufferSize,
|
|
int[] outputChannels)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Configures (or reconfigures) the sink.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#disableTunneling()">disableTunneling</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Disables tunneling.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#enableTunnelingV21()">enableTunnelingV21</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Enables tunneling, if possible.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#experimentalFlushWithoutAudioTrackRelease()">experimentalFlushWithoutAudioTrackRelease</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Flushes the sink, after which it is ready to receive buffers from a new playback position.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#flush()">flush</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Flushes the sink, after which it is ready to receive buffers from a new playback position.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCurrentPositionUs(boolean)">getCurrentPositionUs</a></span>​(boolean sourceEnded)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the playback position in the stream starting at zero, in microseconds, or <a href="AudioSink.html#CURRENT_POSITION_NOT_SET"><code>AudioSink.CURRENT_POSITION_NOT_SET</code></a> if it is not yet available.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFormatSupport(com.google.android.exoplayer2.Format)">getFormatSupport</a></span>​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the level of support that the sink provides for a given <a href="../Format.html" title="class in com.google.android.exoplayer2"><code>Format</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code><a href="../PlaybackParameters.html" title="class in com.google.android.exoplayer2">PlaybackParameters</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPlaybackParameters()">getPlaybackParameters</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the active <a href="../PlaybackParameters.html" title="class in com.google.android.exoplayer2"><code>PlaybackParameters</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSkipSilenceEnabled()">getSkipSilenceEnabled</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns whether silences are skipped in the audio stream.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#handleBuffer(java.nio.ByteBuffer,long,int)">handleBuffer</a></span>​(<a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top">ByteBuffer</a> buffer,
|
|
long presentationTimeUs,
|
|
int encodedAccessUnitCount)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Attempts to process data from a <a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top"><code>ByteBuffer</code></a>, starting from its current position and
|
|
ending at its limit (exclusive).</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#handleDiscontinuity()">handleDiscontinuity</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Signals to the sink that the next buffer may be discontinuous with the previous buffer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i11" class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasPendingData()">hasPendingData</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns whether the sink has data pending that has not been consumed yet.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isEnded()">isEnded</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns whether <a href="AudioSink.html#playToEndOfStream()"><code>AudioSink.playToEndOfStream()</code></a> has been called and all buffers have been processed.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#pause()">pause</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Pauses playback.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#play()">play</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Starts or resumes consuming audio if initialized.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i15" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#playToEndOfStream()">playToEndOfStream</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Processes any remaining data.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i16" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reset()">reset</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Resets the renderer, releasing any resources that it currently holds.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAudioAttributes(com.google.android.exoplayer2.audio.AudioAttributes)">setAudioAttributes</a></span>​(<a href="AudioAttributes.html" title="class in com.google.android.exoplayer2.audio">AudioAttributes</a> audioAttributes)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Sets attributes for audio playback.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i18" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAudioSessionId(int)">setAudioSessionId</a></span>​(int audioSessionId)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Sets the audio session id.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i19" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAuxEffectInfo(com.google.android.exoplayer2.audio.AuxEffectInfo)">setAuxEffectInfo</a></span>​(<a href="AuxEffectInfo.html" title="class in com.google.android.exoplayer2.audio">AuxEffectInfo</a> auxEffectInfo)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Sets the auxiliary effect.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i20" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setListener(com.google.android.exoplayer2.audio.AudioSink.Listener)">setListener</a></span>​(<a href="AudioSink.Listener.html" title="interface in com.google.android.exoplayer2.audio">AudioSink.Listener</a> listener)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Sets the listener for sink events, which should be the audio renderer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i21" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters)">setPlaybackParameters</a></span>​(<a href="../PlaybackParameters.html" title="class in com.google.android.exoplayer2">PlaybackParameters</a> playbackParameters)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Attempts to set the playback parameters.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i22" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSkipSilenceEnabled(boolean)">setSkipSilenceEnabled</a></span>​(boolean skipSilenceEnabled)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Sets whether silences should be skipped in the audio stream.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i23" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setVolume(float)">setVolume</a></span>​(float volume)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Sets the playback volume.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i24" class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#supportsFormat(com.google.android.exoplayer2.Format)">supportsFormat</a></span>​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns whether the sink supports a given <a href="../Format.html" title="class in com.google.android.exoplayer2"><code>Format</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></h3>
|
|
<code><a href="https://developer.android.com/reference/java/lang/Object.html#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink" target="_top">wait</a></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ============ FIELD DETAIL =========== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="field.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Field Detail</h3>
|
|
<a id="DEFAULT_PLAYBACK_SPEED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>DEFAULT_PLAYBACK_SPEED</h4>
|
|
<pre>public static final float DEFAULT_PLAYBACK_SPEED</pre>
|
|
<div class="block">The default playback speed.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.DEFAULT_PLAYBACK_SPEED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="MIN_PLAYBACK_SPEED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>MIN_PLAYBACK_SPEED</h4>
|
|
<pre>public static final float MIN_PLAYBACK_SPEED</pre>
|
|
<div class="block">The minimum allowed playback speed. Lower values will be constrained to fall in range.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.MIN_PLAYBACK_SPEED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="MAX_PLAYBACK_SPEED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>MAX_PLAYBACK_SPEED</h4>
|
|
<pre>public static final float MAX_PLAYBACK_SPEED</pre>
|
|
<div class="block">The maximum allowed playback speed. Higher values will be constrained to fall in range.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.MAX_PLAYBACK_SPEED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="MIN_PITCH">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>MIN_PITCH</h4>
|
|
<pre>public static final float MIN_PITCH</pre>
|
|
<div class="block">The minimum allowed pitch factor. Lower values will be constrained to fall in range.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.MIN_PITCH">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="MAX_PITCH">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>MAX_PITCH</h4>
|
|
<pre>public static final float MAX_PITCH</pre>
|
|
<div class="block">The maximum allowed pitch factor. Higher values will be constrained to fall in range.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.MAX_PITCH">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="OFFLOAD_MODE_DISABLED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>OFFLOAD_MODE_DISABLED</h4>
|
|
<pre>public static final int OFFLOAD_MODE_DISABLED</pre>
|
|
<div class="block">The audio sink will never play in offload mode.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.OFFLOAD_MODE_DISABLED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED</h4>
|
|
<pre>public static final int OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED</pre>
|
|
<div class="block">The audio sink will prefer offload playback except if the track is gapless and the device does
|
|
not advertise support for gapless playback in offload.
|
|
|
|
<p>Use this option to prioritize seamless transitions between tracks of the same album to power
|
|
savings.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.OFFLOAD_MODE_ENABLED_GAPLESS_REQUIRED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="OFFLOAD_MODE_ENABLED_GAPLESS_NOT_REQUIRED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>OFFLOAD_MODE_ENABLED_GAPLESS_NOT_REQUIRED</h4>
|
|
<pre>public static final int OFFLOAD_MODE_ENABLED_GAPLESS_NOT_REQUIRED</pre>
|
|
<div class="block">The audio sink will prefer offload playback even if this might result in silence gaps between
|
|
tracks.
|
|
|
|
<p>Use this option to prioritize battery saving at the cost of a possible non seamless
|
|
transitions between tracks of the same album.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer2.audio.DefaultAudioSink.OFFLOAD_MODE_ENABLED_GAPLESS_NOT_REQUIRED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="failOnSpuriousAudioTimestamp">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>failOnSpuriousAudioTimestamp</h4>
|
|
<pre>public static boolean failOnSpuriousAudioTimestamp</pre>
|
|
<div class="block">Whether to throw an <a href="DefaultAudioSink.InvalidAudioTrackTimestampException.html" title="class in com.google.android.exoplayer2.audio"><code>DefaultAudioSink.InvalidAudioTrackTimestampException</code></a> when a spurious timestamp is
|
|
reported from <a href="https://developer.android.com/reference/android/media/AudioTrack.html#getTimestamp(android.media.AudioTimestamp)" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack.getTimestamp(android.media.AudioTimestamp)</code></a>.
|
|
<p>
|
|
The flag must be set before creating a player. Should be set to <code>true</code> for testing and
|
|
debugging purposes only.</div>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="constructor.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a id="<init>(com.google.android.exoplayer2.audio.AudioCapabilities,com.google.android.exoplayer2.audio.AudioProcessor[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>DefaultAudioSink</h4>
|
|
<pre>public DefaultAudioSink​(@Nullable
|
|
<a href="AudioCapabilities.html" title="class in com.google.android.exoplayer2.audio">AudioCapabilities</a> audioCapabilities,
|
|
<a href="AudioProcessor.html" title="interface in com.google.android.exoplayer2.audio">AudioProcessor</a>[] audioProcessors)</pre>
|
|
<div class="block">Creates a new default audio sink.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>audioCapabilities</code> - The audio capabilities for playback on this device. May be null if the
|
|
default capabilities (no encoded audio passthrough support) should be assumed.</dd>
|
|
<dd><code>audioProcessors</code> - An array of <a href="AudioProcessor.html" title="interface in com.google.android.exoplayer2.audio"><code>AudioProcessor</code></a>s that will process PCM audio before
|
|
output. May be empty.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="<init>(com.google.android.exoplayer2.audio.AudioCapabilities,com.google.android.exoplayer2.audio.AudioProcessor[],boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>DefaultAudioSink</h4>
|
|
<pre>public DefaultAudioSink​(@Nullable
|
|
<a href="AudioCapabilities.html" title="class in com.google.android.exoplayer2.audio">AudioCapabilities</a> audioCapabilities,
|
|
<a href="AudioProcessor.html" title="interface in com.google.android.exoplayer2.audio">AudioProcessor</a>[] audioProcessors,
|
|
boolean enableFloatOutput)</pre>
|
|
<div class="block">Creates a new default audio sink, optionally using float output for high resolution PCM.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>audioCapabilities</code> - The audio capabilities for playback on this device. May be null if the
|
|
default capabilities (no encoded audio passthrough support) should be assumed.</dd>
|
|
<dd><code>audioProcessors</code> - An array of <a href="AudioProcessor.html" title="interface in com.google.android.exoplayer2.audio"><code>AudioProcessor</code></a>s that will process PCM audio before
|
|
output. May be empty.</dd>
|
|
<dd><code>enableFloatOutput</code> - Whether to enable 32-bit float output. Where possible, 32-bit float
|
|
output will be used if the input is 32-bit float, and also if the input is high resolution
|
|
(24-bit or 32-bit) integer PCM. Audio processing (for example, speed adjustment) will not
|
|
be available when float output is in use.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="<init>(com.google.android.exoplayer2.audio.AudioCapabilities,com.google.android.exoplayer2.audio.DefaultAudioSink.AudioProcessorChain,boolean,boolean,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>DefaultAudioSink</h4>
|
|
<pre>public DefaultAudioSink​(@Nullable
|
|
<a href="AudioCapabilities.html" title="class in com.google.android.exoplayer2.audio">AudioCapabilities</a> audioCapabilities,
|
|
<a href="DefaultAudioSink.AudioProcessorChain.html" title="interface in com.google.android.exoplayer2.audio">DefaultAudioSink.AudioProcessorChain</a> audioProcessorChain,
|
|
boolean enableFloatOutput,
|
|
boolean enableAudioTrackPlaybackParams,
|
|
<a href="DefaultAudioSink.OffloadMode.html" title="annotation in com.google.android.exoplayer2.audio">@OffloadMode</a>
|
|
int offloadMode)</pre>
|
|
<div class="block">Creates a new default audio sink, optionally using float output for high resolution PCM and
|
|
with the specified <code>audioProcessorChain</code>.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>audioCapabilities</code> - The audio capabilities for playback on this device. May be null if the
|
|
default capabilities (no encoded audio passthrough support) should be assumed.</dd>
|
|
<dd><code>audioProcessorChain</code> - An <a href="DefaultAudioSink.AudioProcessorChain.html" title="interface in com.google.android.exoplayer2.audio"><code>DefaultAudioSink.AudioProcessorChain</code></a> which is used to apply playback
|
|
parameters adjustments. The instance passed in must not be reused in other sinks.</dd>
|
|
<dd><code>enableFloatOutput</code> - Whether to enable 32-bit float output. Where possible, 32-bit float
|
|
output will be used if the input is 32-bit float, and also if the input is high resolution
|
|
(24-bit or 32-bit) integer PCM. Float output is supported from API level 21. Audio
|
|
processing (for example, speed adjustment) will not be available when float output is in
|
|
use.</dd>
|
|
<dd><code>enableAudioTrackPlaybackParams</code> - Whether to enable setting playback speed using <a href="https://developer.android.com/reference/android/media/AudioTrack.html#setPlaybackParams(android.media.PlaybackParams)" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack.setPlaybackParams(PlaybackParams)</code></a>, if supported.</dd>
|
|
<dd><code>offloadMode</code> - Audio offload configuration. If an audio format can be both played with
|
|
offload and encoded audio passthrough, it will be played in offload. Audio offload is
|
|
supported from API level 29. Most Android devices can only support one offload <a href="https://developer.android.com/reference/android/media/AudioTrack.html" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack</code></a> at a time and can invalidate it at any time. Thus an app can
|
|
never be guaranteed that it will be able to play in offload. Audio processing (for example,
|
|
speed adjustment) will not be available when offload is in use.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<section role="region">
|
|
<ul class="blockList">
|
|
<li class="blockList"><a id="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a id="setListener(com.google.android.exoplayer2.audio.AudioSink.Listener)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setListener</h4>
|
|
<pre class="methodSignature">public void setListener​(<a href="AudioSink.Listener.html" title="interface in com.google.android.exoplayer2.audio">AudioSink.Listener</a> listener)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setListener(com.google.android.exoplayer2.audio.AudioSink.Listener)">AudioSink</a></code></span></div>
|
|
<div class="block">Sets the listener for sink events, which should be the audio renderer.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setListener(com.google.android.exoplayer2.audio.AudioSink.Listener)">setListener</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>listener</code> - The listener for sink events, which should be the audio renderer.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="supportsFormat(com.google.android.exoplayer2.Format)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>supportsFormat</h4>
|
|
<pre class="methodSignature">public boolean supportsFormat​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#supportsFormat(com.google.android.exoplayer2.Format)">AudioSink</a></code></span></div>
|
|
<div class="block">Returns whether the sink supports a given <a href="../Format.html" title="class in com.google.android.exoplayer2"><code>Format</code></a>.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#supportsFormat(com.google.android.exoplayer2.Format)">supportsFormat</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>format</code> - The format.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>Whether the sink supports the format.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getFormatSupport(com.google.android.exoplayer2.Format)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getFormatSupport</h4>
|
|
<pre class="methodSignature"><a href="AudioSink.SinkFormatSupport.html" title="annotation in com.google.android.exoplayer2.audio">@SinkFormatSupport</a>
|
|
public int getFormatSupport​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#getFormatSupport(com.google.android.exoplayer2.Format)">AudioSink</a></code></span></div>
|
|
<div class="block">Returns the level of support that the sink provides for a given <a href="../Format.html" title="class in com.google.android.exoplayer2"><code>Format</code></a>.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#getFormatSupport(com.google.android.exoplayer2.Format)">getFormatSupport</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>format</code> - The format.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The level of support provided.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getCurrentPositionUs(boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getCurrentPositionUs</h4>
|
|
<pre class="methodSignature">public long getCurrentPositionUs​(boolean sourceEnded)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#getCurrentPositionUs(boolean)">AudioSink</a></code></span></div>
|
|
<div class="block">Returns the playback position in the stream starting at zero, in microseconds, or <a href="AudioSink.html#CURRENT_POSITION_NOT_SET"><code>AudioSink.CURRENT_POSITION_NOT_SET</code></a> if it is not yet available.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#getCurrentPositionUs(boolean)">getCurrentPositionUs</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>sourceEnded</code> - Specify <code>true</code> if no more input buffers will be provided.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The playback position relative to the start of playback, in microseconds.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="configure(com.google.android.exoplayer2.Format,int,int[])">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>configure</h4>
|
|
<pre class="methodSignature">public void configure​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> inputFormat,
|
|
int specifiedBufferSize,
|
|
@Nullable
|
|
int[] outputChannels)
|
|
throws <a href="AudioSink.ConfigurationException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.ConfigurationException</a></pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#configure(com.google.android.exoplayer2.Format,int,int%5B%5D)">AudioSink</a></code></span></div>
|
|
<div class="block">Configures (or reconfigures) the sink.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#configure(com.google.android.exoplayer2.Format,int,int%5B%5D)">configure</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>inputFormat</code> - The format of audio data provided in the input buffers.</dd>
|
|
<dd><code>specifiedBufferSize</code> - A specific size for the playback buffer in bytes, or 0 to infer a
|
|
suitable buffer size.</dd>
|
|
<dd><code>outputChannels</code> - A mapping from input to output channels that is applied to this sink's
|
|
input as a preprocessing step, if handling PCM input. Specify <code>null</code> to leave the
|
|
input unchanged. Otherwise, the element at index <code>i</code> specifies index of the input
|
|
channel to map to output channel <code>i</code> when preprocessing input buffers. After the map
|
|
is applied the audio data will have <code>outputChannels.length</code> channels.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="AudioSink.ConfigurationException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.ConfigurationException</a></code> - If an error occurs configuring the sink.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="play()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>play</h4>
|
|
<pre class="methodSignature">public void play()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#play()">AudioSink</a></code></span></div>
|
|
<div class="block">Starts or resumes consuming audio if initialized.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#play()">play</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="handleDiscontinuity()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>handleDiscontinuity</h4>
|
|
<pre class="methodSignature">public void handleDiscontinuity()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#handleDiscontinuity()">AudioSink</a></code></span></div>
|
|
<div class="block">Signals to the sink that the next buffer may be discontinuous with the previous buffer.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#handleDiscontinuity()">handleDiscontinuity</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="handleBuffer(java.nio.ByteBuffer,long,int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>handleBuffer</h4>
|
|
<pre class="methodSignature">public boolean handleBuffer​(<a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top">ByteBuffer</a> buffer,
|
|
long presentationTimeUs,
|
|
int encodedAccessUnitCount)
|
|
throws <a href="AudioSink.InitializationException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.InitializationException</a>,
|
|
<a href="AudioSink.WriteException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.WriteException</a></pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#handleBuffer(java.nio.ByteBuffer,long,int)">AudioSink</a></code></span></div>
|
|
<div class="block">Attempts to process data from a <a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top"><code>ByteBuffer</code></a>, starting from its current position and
|
|
ending at its limit (exclusive). The position of the <a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top"><code>ByteBuffer</code></a> is advanced by the
|
|
number of bytes that were handled. <a href="AudioSink.Listener.html#onPositionDiscontinuity()"><code>AudioSink.Listener.onPositionDiscontinuity()</code></a> will be called if
|
|
<code>presentationTimeUs</code> is discontinuous with the last buffer handled since the last reset.
|
|
|
|
<p>Returns whether the data was handled in full. If the data was not handled in full then the
|
|
same <a href="https://developer.android.com/reference/java/nio/ByteBuffer.html" title="class or interface in java.nio" class="externalLink" target="_top"><code>ByteBuffer</code></a> must be provided to subsequent calls until it has been fully consumed,
|
|
except in the case of an intervening call to <a href="AudioSink.html#flush()"><code>AudioSink.flush()</code></a> (or to <a href="AudioSink.html#configure(com.google.android.exoplayer2.Format,int,int%5B%5D)"><code>AudioSink.configure(Format,
|
|
int, int[])</code></a> that causes the sink to be flushed).</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#handleBuffer(java.nio.ByteBuffer,long,int)">handleBuffer</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>buffer</code> - The buffer containing audio data.</dd>
|
|
<dd><code>presentationTimeUs</code> - The presentation timestamp of the buffer in microseconds.</dd>
|
|
<dd><code>encodedAccessUnitCount</code> - The number of encoded access units in the buffer, or 1 if the
|
|
buffer contains PCM audio. This allows batching multiple encoded access units in one
|
|
buffer.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>Whether the buffer was handled fully.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="AudioSink.InitializationException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.InitializationException</a></code> - If an error occurs initializing the sink.</dd>
|
|
<dd><code><a href="AudioSink.WriteException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.WriteException</a></code> - If an error occurs writing the audio data.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="playToEndOfStream()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>playToEndOfStream</h4>
|
|
<pre class="methodSignature">public void playToEndOfStream()
|
|
throws <a href="AudioSink.WriteException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.WriteException</a></pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#playToEndOfStream()">AudioSink</a></code></span></div>
|
|
<div class="block">Processes any remaining data. <a href="AudioSink.html#isEnded()"><code>AudioSink.isEnded()</code></a> will return <code>true</code> when no data remains.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#playToEndOfStream()">playToEndOfStream</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="AudioSink.WriteException.html" title="class in com.google.android.exoplayer2.audio">AudioSink.WriteException</a></code> - If an error occurs draining data to the sink.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="isEnded()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>isEnded</h4>
|
|
<pre class="methodSignature">public boolean isEnded()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#isEnded()">AudioSink</a></code></span></div>
|
|
<div class="block">Returns whether <a href="AudioSink.html#playToEndOfStream()"><code>AudioSink.playToEndOfStream()</code></a> has been called and all buffers have been processed.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#isEnded()">isEnded</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="hasPendingData()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>hasPendingData</h4>
|
|
<pre class="methodSignature">public boolean hasPendingData()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#hasPendingData()">AudioSink</a></code></span></div>
|
|
<div class="block">Returns whether the sink has data pending that has not been consumed yet.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#hasPendingData()">hasPendingData</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setPlaybackParameters</h4>
|
|
<pre class="methodSignature">public void setPlaybackParameters​(<a href="../PlaybackParameters.html" title="class in com.google.android.exoplayer2">PlaybackParameters</a> playbackParameters)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters)">AudioSink</a></code></span></div>
|
|
<div class="block">Attempts to set the playback parameters. The audio sink may override these parameters if they
|
|
are not supported.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setPlaybackParameters(com.google.android.exoplayer2.PlaybackParameters)">setPlaybackParameters</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>playbackParameters</code> - The new playback parameters to attempt to set.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getPlaybackParameters()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPlaybackParameters</h4>
|
|
<pre class="methodSignature">public <a href="../PlaybackParameters.html" title="class in com.google.android.exoplayer2">PlaybackParameters</a> getPlaybackParameters()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#getPlaybackParameters()">AudioSink</a></code></span></div>
|
|
<div class="block">Returns the active <a href="../PlaybackParameters.html" title="class in com.google.android.exoplayer2"><code>PlaybackParameters</code></a>.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#getPlaybackParameters()">getPlaybackParameters</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setSkipSilenceEnabled(boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSkipSilenceEnabled</h4>
|
|
<pre class="methodSignature">public void setSkipSilenceEnabled​(boolean skipSilenceEnabled)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setSkipSilenceEnabled(boolean)">AudioSink</a></code></span></div>
|
|
<div class="block">Sets whether silences should be skipped in the audio stream.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setSkipSilenceEnabled(boolean)">setSkipSilenceEnabled</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="getSkipSilenceEnabled()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSkipSilenceEnabled</h4>
|
|
<pre class="methodSignature">public boolean getSkipSilenceEnabled()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#getSkipSilenceEnabled()">AudioSink</a></code></span></div>
|
|
<div class="block">Returns whether silences are skipped in the audio stream.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#getSkipSilenceEnabled()">getSkipSilenceEnabled</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setAudioAttributes(com.google.android.exoplayer2.audio.AudioAttributes)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setAudioAttributes</h4>
|
|
<pre class="methodSignature">public void setAudioAttributes​(<a href="AudioAttributes.html" title="class in com.google.android.exoplayer2.audio">AudioAttributes</a> audioAttributes)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setAudioAttributes(com.google.android.exoplayer2.audio.AudioAttributes)">AudioSink</a></code></span></div>
|
|
<div class="block">Sets attributes for audio playback. If the attributes have changed and if the sink is not
|
|
configured for use with tunneling, then it is reset and the audio session id is cleared.
|
|
<p>
|
|
If the sink is configured for use with tunneling then the audio attributes are ignored. The
|
|
sink is not reset and the audio session id is not cleared. The passed attributes will be used
|
|
if the sink is later re-configured into non-tunneled mode.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setAudioAttributes(com.google.android.exoplayer2.audio.AudioAttributes)">setAudioAttributes</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>audioAttributes</code> - The attributes for audio playback.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setAudioSessionId(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setAudioSessionId</h4>
|
|
<pre class="methodSignature">public void setAudioSessionId​(int audioSessionId)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setAudioSessionId(int)">AudioSink</a></code></span></div>
|
|
<div class="block">Sets the audio session id.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setAudioSessionId(int)">setAudioSessionId</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setAuxEffectInfo(com.google.android.exoplayer2.audio.AuxEffectInfo)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setAuxEffectInfo</h4>
|
|
<pre class="methodSignature">public void setAuxEffectInfo​(<a href="AuxEffectInfo.html" title="class in com.google.android.exoplayer2.audio">AuxEffectInfo</a> auxEffectInfo)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setAuxEffectInfo(com.google.android.exoplayer2.audio.AuxEffectInfo)">AudioSink</a></code></span></div>
|
|
<div class="block">Sets the auxiliary effect.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setAuxEffectInfo(com.google.android.exoplayer2.audio.AuxEffectInfo)">setAuxEffectInfo</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="enableTunnelingV21()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>enableTunnelingV21</h4>
|
|
<pre class="methodSignature">public void enableTunnelingV21()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#enableTunnelingV21()">AudioSink</a></code></span></div>
|
|
<div class="block">Enables tunneling, if possible. The sink is reset if tunneling was previously disabled.
|
|
Enabling tunneling is only possible if the sink is based on a platform <a href="https://developer.android.com/reference/android/media/AudioTrack.html" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack</code></a>, and
|
|
requires platform API version 21 onwards.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#enableTunnelingV21()">enableTunnelingV21</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="disableTunneling()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>disableTunneling</h4>
|
|
<pre class="methodSignature">public void disableTunneling()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#disableTunneling()">AudioSink</a></code></span></div>
|
|
<div class="block">Disables tunneling. If tunneling was previously enabled then the sink is reset and any audio
|
|
session id is cleared.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#disableTunneling()">disableTunneling</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="setVolume(float)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setVolume</h4>
|
|
<pre class="methodSignature">public void setVolume​(float volume)</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#setVolume(float)">AudioSink</a></code></span></div>
|
|
<div class="block">Sets the playback volume.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#setVolume(float)">setVolume</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>volume</code> - Linear output gain to apply to all channels. Should be in the range [0.0, 1.0].</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="pause()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>pause</h4>
|
|
<pre class="methodSignature">public void pause()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#pause()">AudioSink</a></code></span></div>
|
|
<div class="block">Pauses playback.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#pause()">pause</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="flush()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>flush</h4>
|
|
<pre class="methodSignature">public void flush()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#flush()">AudioSink</a></code></span></div>
|
|
<div class="block">Flushes the sink, after which it is ready to receive buffers from a new playback position.
|
|
|
|
<p>The audio session may remain active until <a href="AudioSink.html#reset()"><code>AudioSink.reset()</code></a> is called.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#flush()">flush</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="experimentalFlushWithoutAudioTrackRelease()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>experimentalFlushWithoutAudioTrackRelease</h4>
|
|
<pre class="methodSignature">public void experimentalFlushWithoutAudioTrackRelease()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#experimentalFlushWithoutAudioTrackRelease()">AudioSink</a></code></span></div>
|
|
<div class="block">Flushes the sink, after which it is ready to receive buffers from a new playback position.
|
|
|
|
<p>Does not release the <a href="https://developer.android.com/reference/android/media/AudioTrack.html" title="class or interface in android.media" class="externalLink" target="_top"><code>AudioTrack</code></a> held by the sink.
|
|
|
|
<p>This method is experimental, and will be renamed or removed in a future release.
|
|
|
|
<p>Only for experimental use as part of <a href="MediaCodecAudioRenderer.html#experimentalSetEnableKeepAudioTrackOnSeek(boolean)"><code>MediaCodecAudioRenderer.experimentalSetEnableKeepAudioTrackOnSeek(boolean)</code></a>.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#experimentalFlushWithoutAudioTrackRelease()">experimentalFlushWithoutAudioTrackRelease</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a id="reset()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>reset</h4>
|
|
<pre class="methodSignature">public void reset()</pre>
|
|
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="AudioSink.html#reset()">AudioSink</a></code></span></div>
|
|
<div class="block">Resets the renderer, releasing any resources that it currently holds.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code><a href="AudioSink.html#reset()">reset</a></code> in interface <code><a href="AudioSink.html" title="interface in com.google.android.exoplayer2.audio">AudioSink</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<footer role="contentinfo">
|
|
<nav role="navigation">
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a id="navbar.bottom">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a id="navbar.bottom.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../../../index.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../../../index-all.html">Index</a></li>
|
|
<li><a href="../../../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../../../allclasses.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
|
<li><a href="#field.summary">Field</a> | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field.detail">Field</a> | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a id="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
</nav>
|
|
</footer>
|
|
</body>
|
|
</html>
|