<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_77) on Fri Apr 22 13:46:47 UTC 2016 --> <title>AudioClip (JavaFX 8)</title> <meta name="date" content="2016-04-22"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="AudioClip (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":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 methods = {"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}; 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"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/AudioClip.html">Use</a></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 class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev Class</li> <li><a href="../../../javafx/scene/media/AudioEqualizer.html" title="class in javafx.scene.media"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/media/AudioClip.html" target="_top">Frames</a></li> <li><a href="AudioClip.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></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> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </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 name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javafx.scene.media</div> <h2 title="Class AudioClip" class="title">Class AudioClip</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>javafx.scene.media.AudioClip</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public final class <span class="typeNameLabel">AudioClip</span> extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">An <code>AudioClip</code> represents a segment of audio that can be played with minimal latency. Clips are loaded similarly to <code>Media</code> objects but have different behavior, for example, a <code>Media</code> cannot play itself. <code>AudioClip</code>s are also usable immediately. Playback behavior is fire and forget: once one of the play methods is called the only operable control is <a href="../../../javafx/scene/media/AudioClip.html#stop--"><code>stop()</code></a>. An <code>AudioClip</code> may also be played multiple times simultaneously. To accomplish the same task using <code>Media</code> one would have to create a new <code>MediaPlayer</code> object for each sound played in parallel. <code>Media</code> objects are however better suited for long-playing sounds. This is primarily because <code>AudioClip</code> stores in memory the raw, uncompressed audio data for the entire sound, which can be quite large for long audio clips. A <code>MediaPlayer</code> will only have enough decompressed audio data pre-rolled in memory to play for a short amount of time so it is much more memory efficient for long clips, especially if they are compressed. <br> <p>Example usage: <pre><code> AudioClip plonkSound = new AudioClip("http://somehost/path/plonk.aiff"); plonkSound.play(); </code></pre> </p></div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.0</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== PROPERTY SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="property.summary"> <!-- --> </a> <h3>Property Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Property Summary table, listing properties, and an explanation"> <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">Type</th> <th class="colLast" scope="col">Property and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#balanceProperty">balance</a></span></code> <div class="block">The relative left and right volume levels of the clip.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#cycleCountProperty">cycleCount</a></span></code> <div class="block">The number of times the clip will be played when <a href="../../../javafx/scene/media/AudioClip.html#play--"><code>play()</code></a> is called.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#panProperty">pan</a></span></code> <div class="block">The relative "center" of the clip.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#priorityProperty">priority</a></span></code> <div class="block">The relative priority of the clip with respect to other clips.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#rateProperty">rate</a></span></code> <div class="block">The relative rate at which the clip is played.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#volumeProperty">volume</a></span></code> <div class="block">The relative volume level at which the clip is played.</div> </td> </tr> </table> </li> </ul> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#INDEFINITE">INDEFINITE</a></span></code> <div class="block">When <a href="../../../javafx/scene/media/AudioClip.html#cycleCountProperty--"><code>cycleCount</code></a> is set to this value, the <code>AudioClip</code> will loop continuously until stopped.</div> </td> </tr> </table> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#AudioClip-java.lang.String-">AudioClip</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> source)</code> <div class="block">Create an <code>AudioClip</code> loaded from the supplied source URL.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <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="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#balanceProperty--">balanceProperty</a></span>()</code> <div class="block">The relative left and right volume levels of the clip.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#cycleCountProperty--">cycleCountProperty</a></span>()</code> <div class="block">The number of times the clip will be played when <a href="../../../javafx/scene/media/AudioClip.html#play--"><code>play()</code></a> is called.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getBalance--">getBalance</a></span>()</code> <div class="block">Get the default balance level for this clip.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getCycleCount--">getCycleCount</a></span>()</code> <div class="block">Get the default cycle count.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getPan--">getPan</a></span>()</code> <div class="block">Get the default pan value.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getPriority--">getPriority</a></span>()</code> <div class="block">Get the default playback priority.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getRate--">getRate</a></span>()</code> <div class="block">Get the default playback rate.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getSource--">getSource</a></span>()</code> <div class="block">Get the source URL used to create this <code>AudioClip</code>.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#getVolume--">getVolume</a></span>()</code> <div class="block">Get the default volume level.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#isPlaying--">isPlaying</a></span>()</code> <div class="block">Indicate whether this <code>AudioClip</code> is playing.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#panProperty--">panProperty</a></span>()</code> <div class="block">The relative "center" of the clip.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#play--">play</a></span>()</code> <div class="block">Play the <code>AudioClip</code> using all the default parameters.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#play-double-">play</a></span>(double volume)</code> <div class="block">Play the <code>AudioClip</code> using all the default parameters except volume.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#play-double-double-double-double-int-">play</a></span>(double volume, double balance, double rate, double pan, int priority)</code> <div class="block">Play the <code>AudioClip</code> using the given parameters.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#priorityProperty--">priorityProperty</a></span>()</code> <div class="block">The relative priority of the clip with respect to other clips.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#rateProperty--">rateProperty</a></span>()</code> <div class="block">The relative rate at which the clip is played.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#setBalance-double-">setBalance</a></span>(double balance)</code> <div class="block">Set the default balance level.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#setCycleCount-int-">setCycleCount</a></span>(int count)</code> <div class="block">Set the default cycle count.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#setPan-double-">setPan</a></span>(double pan)</code> <div class="block">Set the default pan value.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#setPriority-int-">setPriority</a></span>(int priority)</code> <div class="block">Set the default playback priority.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#setRate-double-">setRate</a></span>(double rate)</code> <div class="block">Set the default playback rate.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#setVolume-double-">setVolume</a></span>(double value)</code> <div class="block">Set the default volume level.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#stop--">stop</a></span>()</code> <div class="block">Immediately stop all playback of this <code>AudioClip</code>.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/media/AudioClip.html#volumeProperty--">volumeProperty</a></span>()</code> <div class="block">The relative volume level at which the clip is played.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ PROPERTY DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="property.detail"> <!-- --> </a> <h3>Property Detail</h3> <a name="volumeProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>volume</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> volumeProperty</pre> <div class="block">The relative volume level at which the clip is played. Valid range is 0.0 (muted) to 1.0 (full volume). Values are clamped to this range internally so values outside this range will have no additional effect. Volume is controlled by attenuation, so values below 1.0 will reduce the sound level accordingly.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getVolume--"><code>getVolume()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setVolume-double-"><code>setVolume(double)</code></a></dd> </dl> </li> </ul> <a name="balanceProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>balance</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> balanceProperty</pre> <div class="block">The relative left and right volume levels of the clip. Valid range is -1.0 to 1.0 where -1.0 gives full volume to the left channel while muting the right channel, 0.0 gives full volume to both channels and 1.0 gives full volume to right channel and mutes the left channel. Values outside this range are clamped internally.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getBalance--"><code>getBalance()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setBalance-double-"><code>setBalance(double)</code></a></dd> </dl> </li> </ul> <a name="rateProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>rate</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> rateProperty</pre> <div class="block">The relative rate at which the clip is played. Valid range is 0.125 (1/8 speed) to 8.0 (8x speed); values outside this range are clamped internally. Normal playback for a clip is 1.0; any other rate will affect pitch and duration accordingly.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getRate--"><code>getRate()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setRate-double-"><code>setRate(double)</code></a></dd> </dl> </li> </ul> <a name="panProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>pan</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> panProperty</pre> <div class="block">The relative "center" of the clip. A pan value of 0.0 plays the clip normally where a -1.0 pan shifts the clip entirely to the left channel and 1.0 shifts entirely to the right channel. Unlike balance this setting mixes both channels so neither channel loses data. Setting pan on a mono clip has the same effect as setting balance, but with a much higher cost in CPU overhead so this is not recommended for mono clips.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getPan--"><code>getPan()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setPan-double-"><code>setPan(double)</code></a></dd> </dl> </li> </ul> <a name="priorityProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>priority</h4> <pre>public <a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a> priorityProperty</pre> <div class="block">The relative priority of the clip with respect to other clips. This value is used to determine which clips to remove when the maximum allowed number of clips is exceeded. The lower the priority, the more likely the clip is to be stopped and removed from the mixer channel it is occupying. Valid range is any integer; there are no constraints. The default priority is zero for all clips until changed. The number of simultaneous sounds that can be played is implementation- and possibly system-dependent.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getPriority--"><code>getPriority()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setPriority-int-"><code>setPriority(int)</code></a></dd> </dl> </li> </ul> <a name="cycleCountProperty"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>cycleCount</h4> <pre>public <a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a> cycleCountProperty</pre> <div class="block">The number of times the clip will be played when <a href="../../../javafx/scene/media/AudioClip.html#play--"><code>play()</code></a> is called. A cycleCount of 1 plays exactly once, a cycleCount of 2 plays twice and so on. Valid range is 1 or more, but setting this to <a href="../../../javafx/scene/media/AudioClip.html#INDEFINITE"><code>INDEFINITE</code></a> will cause the clip to continue looping until <a href="../../../javafx/scene/media/AudioClip.html#stop--"><code>stop()</code></a> is called.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getCycleCount--"><code>getCycleCount()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setCycleCount-int-"><code>setCycleCount(int)</code></a></dd> </dl> </li> </ul> </li> </ul> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="INDEFINITE"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>INDEFINITE</h4> <pre>public static final int INDEFINITE</pre> <div class="block">When <a href="../../../javafx/scene/media/AudioClip.html#cycleCountProperty--"><code>cycleCount</code></a> is set to this value, the <code>AudioClip</code> will loop continuously until stopped. This value is synonymous with <a href="../../../javafx/scene/media/MediaPlayer.html#INDEFINITE"><code>MediaPlayer.INDEFINITE</code></a> and <a href="../../../javafx/animation/Animation.html#INDEFINITE"><code>Animation.INDEFINITE</code></a>, these values may be used interchangeably.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../constant-values.html#javafx.scene.media.AudioClip.INDEFINITE">Constant Field Values</a></dd> </dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="AudioClip-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>AudioClip</h4> <pre>public AudioClip(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> source)</pre> <div class="block">Create an <code>AudioClip</code> loaded from the supplied source URL.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>source</code> - URL string from which to load the audio clip. This can be an HTTP, HTTPS, FILE or JAR source.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the parameter is <code>null</code>.</dd> <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the parameter violates <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC 2396</a>.</dd> <dd><code><a href="../../../javafx/scene/media/MediaException.html" title="class in javafx.scene.media">MediaException</a></code> - if there is some other problem loading the media.</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getSource--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSource</h4> <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getSource()</pre> <div class="block">Get the source URL used to create this <code>AudioClip</code>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>source URL as provided to the constructor</dd> </dl> </li> </ul> <a name="setVolume-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setVolume</h4> <pre>public final void setVolume(double value)</pre> <div class="block">Set the default volume level. The new setting will only take effect on subsequent plays.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - new default volume level for this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#volume"><code>volume</code></a></dd> </dl> </li> </ul> <a name="getVolume--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getVolume</h4> <pre>public final double getVolume()</pre> <div class="block">Get the default volume level.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the default volume level for this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#volume"><code>volume</code></a></dd> </dl> </li> </ul> <a name="volumeProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>volumeProperty</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> volumeProperty()</pre> <div class="block">The relative volume level at which the clip is played. Valid range is 0.0 (muted) to 1.0 (full volume). Values are clamped to this range internally so values outside this range will have no additional effect. Volume is controlled by attenuation, so values below 1.0 will reduce the sound level accordingly.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getVolume--"><code>getVolume()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setVolume-double-"><code>setVolume(double)</code></a></dd> </dl> </li> </ul> <a name="setBalance-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setBalance</h4> <pre>public void setBalance(double balance)</pre> <div class="block">Set the default balance level. The new value will only affect subsequent plays.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>balance</code> - new default balance</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#balance"><code>balance</code></a></dd> </dl> </li> </ul> <a name="getBalance--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getBalance</h4> <pre>public double getBalance()</pre> <div class="block">Get the default balance level for this clip.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the default balance for this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#balance"><code>balance</code></a></dd> </dl> </li> </ul> <a name="balanceProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>balanceProperty</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> balanceProperty()</pre> <div class="block">The relative left and right volume levels of the clip. Valid range is -1.0 to 1.0 where -1.0 gives full volume to the left channel while muting the right channel, 0.0 gives full volume to both channels and 1.0 gives full volume to right channel and mutes the left channel. Values outside this range are clamped internally.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getBalance--"><code>getBalance()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setBalance-double-"><code>setBalance(double)</code></a></dd> </dl> </li> </ul> <a name="setRate-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setRate</h4> <pre>public void setRate(double rate)</pre> <div class="block">Set the default playback rate. The new value will only affect subsequent plays.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>rate</code> - the new default playback rate</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#rate"><code>rate</code></a></dd> </dl> </li> </ul> <a name="getRate--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getRate</h4> <pre>public double getRate()</pre> <div class="block">Get the default playback rate.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>default playback rate for this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#rate"><code>rate</code></a></dd> </dl> </li> </ul> <a name="rateProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>rateProperty</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> rateProperty()</pre> <div class="block">The relative rate at which the clip is played. Valid range is 0.125 (1/8 speed) to 8.0 (8x speed); values outside this range are clamped internally. Normal playback for a clip is 1.0; any other rate will affect pitch and duration accordingly.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getRate--"><code>getRate()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setRate-double-"><code>setRate(double)</code></a></dd> </dl> </li> </ul> <a name="setPan-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setPan</h4> <pre>public void setPan(double pan)</pre> <div class="block">Set the default pan value. The new value will only affect subsequent plays.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>pan</code> - the new default pan value</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#pan"><code>pan</code></a></dd> </dl> </li> </ul> <a name="getPan--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPan</h4> <pre>public double getPan()</pre> <div class="block">Get the default pan value.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the default pan value for this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#pan"><code>pan</code></a></dd> </dl> </li> </ul> <a name="panProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>panProperty</h4> <pre>public <a href="../../../javafx/beans/property/DoubleProperty.html" title="class in javafx.beans.property">DoubleProperty</a> panProperty()</pre> <div class="block">The relative "center" of the clip. A pan value of 0.0 plays the clip normally where a -1.0 pan shifts the clip entirely to the left channel and 1.0 shifts entirely to the right channel. Unlike balance this setting mixes both channels so neither channel loses data. Setting pan on a mono clip has the same effect as setting balance, but with a much higher cost in CPU overhead so this is not recommended for mono clips.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getPan--"><code>getPan()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setPan-double-"><code>setPan(double)</code></a></dd> </dl> </li> </ul> <a name="setPriority-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setPriority</h4> <pre>public void setPriority(int priority)</pre> <div class="block">Set the default playback priority. The new value will only affect subsequent plays.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>priority</code> - the new default playback priority</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#priority"><code>priority</code></a></dd> </dl> </li> </ul> <a name="getPriority--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getPriority</h4> <pre>public int getPriority()</pre> <div class="block">Get the default playback priority.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the default playback priority of this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#priority"><code>priority</code></a></dd> </dl> </li> </ul> <a name="priorityProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>priorityProperty</h4> <pre>public <a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a> priorityProperty()</pre> <div class="block">The relative priority of the clip with respect to other clips. This value is used to determine which clips to remove when the maximum allowed number of clips is exceeded. The lower the priority, the more likely the clip is to be stopped and removed from the mixer channel it is occupying. Valid range is any integer; there are no constraints. The default priority is zero for all clips until changed. The number of simultaneous sounds that can be played is implementation- and possibly system-dependent.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getPriority--"><code>getPriority()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setPriority-int-"><code>setPriority(int)</code></a></dd> </dl> </li> </ul> <a name="setCycleCount-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setCycleCount</h4> <pre>public void setCycleCount(int count)</pre> <div class="block">Set the default cycle count. The new value will only affect subsequent plays.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>count</code> - the new default cycle count for this clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#cycleCount"><code>cycleCount</code></a></dd> </dl> </li> </ul> <a name="getCycleCount--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getCycleCount</h4> <pre>public int getCycleCount()</pre> <div class="block">Get the default cycle count.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the default cycleCount for this audio clip</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#cycleCount"><code>cycleCount</code></a></dd> </dl> </li> </ul> <a name="cycleCountProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>cycleCountProperty</h4> <pre>public <a href="../../../javafx/beans/property/IntegerProperty.html" title="class in javafx.beans.property">IntegerProperty</a> cycleCountProperty()</pre> <div class="block">The number of times the clip will be played when <a href="../../../javafx/scene/media/AudioClip.html#play--"><code>play()</code></a> is called. A cycleCount of 1 plays exactly once, a cycleCount of 2 plays twice and so on. Valid range is 1 or more, but setting this to <a href="../../../javafx/scene/media/AudioClip.html#INDEFINITE"><code>INDEFINITE</code></a> will cause the clip to continue looping until <a href="../../../javafx/scene/media/AudioClip.html#stop--"><code>stop()</code></a> is called.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/media/AudioClip.html#getCycleCount--"><code>getCycleCount()</code></a>, <a href="../../../javafx/scene/media/AudioClip.html#setCycleCount-int-"><code>setCycleCount(int)</code></a></dd> </dl> </li> </ul> <a name="play--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>play</h4> <pre>public void play()</pre> <div class="block">Play the <code>AudioClip</code> using all the default parameters.</div> </li> </ul> <a name="play-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>play</h4> <pre>public void play(double volume)</pre> <div class="block">Play the <code>AudioClip</code> using all the default parameters except volume. This method does not modify the clip's default parameters.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>volume</code> - the volume level at which to play the clip</dd> </dl> </li> </ul> <a name="play-double-double-double-double-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>play</h4> <pre>public void play(double volume, double balance, double rate, double pan, int priority)</pre> <div class="block">Play the <code>AudioClip</code> using the given parameters. Values outside the ranges as specified by their associated properties are clamped. This method does not modify the clip's default parameters.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>volume</code> - Volume level at which to play this clip. Valid volume range is 0.0 to 1.0, where 0.0 is effectively muted and 1.0 is full volume.</dd> <dd><code>balance</code> - Left/right balance or relative channel volumes for stereo effects.</dd> <dd><code>rate</code> - Playback rate multiplier. 1.0 will play at the normal rate while 2.0 will double the rate.</dd> <dd><code>pan</code> - Left/right shift to be applied to the clip. A pan value of -1.0 means full left channel, 1.0 means full right channel, 0.0 has no effect.</dd> <dd><code>priority</code> - Audio effect priority. Lower priority effects will be dropped first if too many effects are trying to play simultaneously.</dd> </dl> </li> </ul> <a name="isPlaying--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isPlaying</h4> <pre>public boolean isPlaying()</pre> <div class="block">Indicate whether this <code>AudioClip</code> is playing. If this returns true then <code>play()</code> has been called at least once and it is still playing.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if any mixer channel has this clip queued, false otherwise</dd> </dl> </li> </ul> <a name="stop--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>stop</h4> <pre>public void stop()</pre> <div class="block">Immediately stop all playback of this <code>AudioClip</code>.</div> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/AudioClip.html">Use</a></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 class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev Class</li> <li><a href="../../../javafx/scene/media/AudioEqualizer.html" title="class in javafx.scene.media"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/media/AudioClip.html" target="_top">Frames</a></li> <li><a href="AudioClip.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.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> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </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 name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><small><a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html">Copyright</a> (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.</small></small></p> </body> </html>