AudioBufferPlayer_v2 Op

AudioBufferPlayer

Play back audio data stored in an AudioBuffer


<p>Typically connected to a <a href="/op/Ops.WebAudio.AudioBuffer">Ops.WebAudio.AudioBuffer</a>, which holds the sample / audio file. In contrast to the <a href="https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode">Web Audio AudioBufferSourceNode</a>, which can only play back an AudioBuffer once, this op can play back multiple times (every time the playback finished a new <code>AudioBufferSourceNode</code> is being created internally). </p>


Full Name
  • Ops.WebAudio.AudioBufferPlayer_v2
Visibility
  • Core Op - Official cables op
License
  • MIT
AuthorgithubTest Patches


Example Patch AudioBuffer Play Stop Seek

Shows how to play / pause / seek an audio file

Open In Editor

INPUT PORTS


Audio Buffer (Object:audioBuffer)

<p>The audio buffer (typically from an audio file) which contains the audio data. In most cases you need to create a <code>AudioBuffer</code> op to load your audio sample and connect it to this port.</p>

Playback Controls

Start / Stop (Number:

<i>boolean</i>

)

<p>When set the playback is started</p>

Loop (Number:

<i>boolean</i>

)

<p>Weather or not the playback should start from the beginning once the end has been reached. Please note that some browsers have problems doing a perfect loop with certain file types. If you e.g. use an MP3-file as <code>AudioBuffer</code> Google Chrome might produce a slight gap between the loops. Ogg-files sometimes work better.</p>

Restart (Trigger)

<p>trigger to restart the playback</p>

Time Controls

Offset (Number)

<p>Shifts the playback position</p>

Miscellaneous

Playback Rate (Number)

<p>How fast / slow the audio should be played back, <code>1</code> is normal speed, <code>2</code> double speed, <code>0.5</code> half speed.</p>

Detune (Number)

<p>How much the sound should be detuned in <a href="https://en.wikipedia.org/wiki/Cent_(music)">cents</a>. <code>-100</code> means one semitone lower, <code>100</code> one semitone higher, <code>1200</code> is one octave higher (<code>12 * 100</code>).</p>

OUTPUT PORTS


Audio Out (Object)

<p>The audio out object</p>

Is Playing (

<i>boolean</i>

Number)

<p>returns true if audio file is playing, false if not</p>

Loading (

<i>boolean</i>

Number)

<p>true if currently loading an audio source</p>


Patches using AudioBufferPlayer_v2

  • Examples
  • Public
  • My Patches

Changelog


cloned op from Ops.WebAudio.AudioBufferPlayeruser avatarsimod - 2020-11-16 17:40
Ops.User.cables.AudioBufPlayer_v2 renamed to Ops.WebAudio.AudioBufferPlayer_v2user avatarsimod - 2020-11-17 14:52
removed non-working start/stop ports, fixed restartuser avatarstephan - 2022-05-16 15:24