1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00
psychojs/docs/module-sound.SoundPlayer.html
2018-11-18 20:37:05 +01:00

948 lines
12 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Interface: SoundPlayer</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Interface: SoundPlayer</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="module-sound.html">sound</a>.</span>SoundPlayer</h2>
</header>
<article>
<div class="container-overview">
<div class="description"><p>SoundPlayer is an interface for the sound players, who are responsible for actually playing the sounds, i.e. the tracks or the tones.</p></div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line13">line 13</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>PsychObject</li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".accept"><span class="type-signature">(abstract, static) </span>accept<span class="signature">()</span><span class="type-signature"> &rarr; {Object|undefined}</span></h4>
<div class="description">
Determine whether this player can play the given sound.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="type">
<span class="param-type"><a href="module-sound.Sound.html">module:sound.Sound</a></span>
</td>
<td class="description last">the sound</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line29">line 29</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
an instance of the SoundPlayer that can play the sound, or undefined if none could be found
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
|
<span class="param-type">undefined</span>
</dd>
</dl>
<h4 class="name" id="getDuration"><span class="type-signature">(abstract) </span>getDuration<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Get the duration of the sound, in seconds.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line75">line 75</a>
</li></ul></dd>
</dl>
<h4 class="name" id="play"><span class="type-signature">(abstract) </span>play<span class="signature">(loops<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Start playing the sound.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>loops</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">how many times to repeat the sound after it has played once. If loops == -1, the sound will repeat indefinitely until stopped.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line46">line 46</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setLoops"><span class="type-signature">(abstract) </span>setLoops<span class="signature">(loops)</span><span class="type-signature"></span></h4>
<div class="description">
Set the number of loops.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>loops</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="description last">how many times to repeat the sound after it has played once. If loops == -1, the sound will repeat indefinitely until stopped.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line89">line 89</a>
</li></ul></dd>
</dl>
<h4 class="name" id="setVolume"><span class="type-signature">(abstract) </span>setVolume<span class="signature">(volume, mute<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Set the volume of the tone.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>volume</code></td>
<td class="type">
<span class="param-type">Integer</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">the volume of the tone</td>
</tr>
<tr>
<td class="name"><code>mute</code></td>
<td class="type">
<span class="param-type">booleam</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last">whether or not to mute the tone</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line104">line 104</a>
</li></ul></dd>
</dl>
<h4 class="name" id="stop"><span class="type-signature">(abstract) </span>stop<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Stop playing the sound immediately.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="sound_SoundPlayer.js.html">sound/SoundPlayer.js</a>, <a href="sound_SoundPlayer.js.html#line61">line 61</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-core.html">core</a></li><li><a href="module-data.html">data</a></li><li><a href="module-sound.html">sound</a></li><li><a href="module-visual.html">visual</a></li></ul><h3>Classes</h3><ul><li><a href="module-core.BuilderKeyResponse.html">BuilderKeyResponse</a></li><li><a href="module-core.EventManager.html">EventManager</a></li><li><a href="module-core.GUI.html">GUI</a></li><li><a href="module-core.MinimalStim.html">MinimalStim</a></li><li><a href="module-core.Mouse.html">Mouse</a></li><li><a href="module-core.PsychoJS.html">PsychoJS</a></li><li><a href="module-core.ServerManager.html">ServerManager</a></li><li><a href="module-core.Window.html">Window</a></li><li><a href="module-data.ExperimentHandler.html">ExperimentHandler</a></li><li><a href="module-data.TrialHandler.html">TrialHandler</a></li><li><a href="module-sound.Sound.html">Sound</a></li><li><a href="module-sound.TonePlayer.html">TonePlayer</a></li><li><a href="module-sound.TrackPlayer.html">TrackPlayer</a></li><li><a href="module-visual.BaseShapeStim.html">BaseShapeStim</a></li><li><a href="module-visual.BaseVisualStim.html">BaseVisualStim</a></li><li><a href="module-visual.ImageStim.html">ImageStim</a></li><li><a href="module-visual.Rect.html">Rect</a></li><li><a href="module-visual.TextStim.html">TextStim</a></li></ul><h3>Mixins</h3><ul><li><a href="module-core.WindowMixin.html">WindowMixin</a></li></ul><h3>Interfaces</h3><ul><li><a href="module-sound.SoundPlayer.html">SoundPlayer</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Nov 18 2018 20:31:50 GMT+0100 (CET)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>