<clip> and <channel>#

To load an audio file, a <clip> element can be inserted at the spot in the timeline where it should be played back. Each <channel> of a multi-channel file can have its own static transform attributes (pos, rot, etc.), as shown in the example scene minimal-multichannel.asd:

<asdf version="0.4">
  <clip file="audio/marimba.ogg">
    <channel pos="-1 2" />
    <channel pos="1 2" />
  </clip>
</asdf>

If the audio file only has a single channel, an explicit <channel> element is not necessary. If desired, transform attributes can be applied to the <clip> element itself, see minimal.asd:

<asdf version="0.4">
  <clip file="audio/ukewave.ogg" pos="1 2" />
</asdf>

Volume control is part of the <transform> mechanism. A constant volume can be specified with the vol attribute of <clip> and/or <channel>, a dynamic volume envelope can be applied with a <transform> element that’s running in parallel to the <clip> – see <seq> and <par>.

As selecting-channels.asd shows, not all channels of a <clip> have to be used:

<asdf version="0.4">
  <par repeat="3">
    <seq>
      <wait dur="1.18" />
      <clip file="audio/marimba.ogg">
        <channel pos="-2 2" />
        <!-- NB: second channel is unused -->
      </clip>
    </seq>
    <clip file="audio/marimba.ogg">
      <channel skip="1" />
      <channel pos="2 2" />
    </clip>
  </par>
</asdf>

Audio clips are always played in full length. Audio files should be trimmed to the desired length during scene authoring.

repeat#

<clip> elements can be repeated, see Repetition.

id#

Both <clip> and <channel> elements can be the target of a <transform>, as long as they have an id attribute. <transform> and <clip> can have differing begin and end times. A single <transform> can apply to multiple <clip> and/or <channel> elements. A <clip> can be transformed by multiple <transform> elements over time. The <transform> elements can overlap, but only one of them can contain a rotation in this case (because the order of applying those rotations would be ambiguous).

source#

If no source attribute is given, a <source> is created implicitly for each channel. The order of implicit sources is unspecified. An implementation may re-use an implicit source for multiple clips (as long as the clips don’t overlap in time), but this is not required.

Individual audio channels can also be explicitly assigned to existing <source> elements, as demonstrated in source-transform.asd:

<asdf version="0.4">
  <head>
    <source id="src-one" pos="-1 1" />
    <source id="src-two" pos="1 1" />
  </head>
  <clip file="audio/marimba.ogg">
    <channel source="src-one" />
    <channel source="src-two" />
  </clip>
  <clip file="audio/marimba.ogg">
    <channel source="src-two" />
    <channel source="src-one" />
  </clip>
</asdf>

This illustrates that different <channel> elements can be assigned to the same <source>. However, this only works if the channels don’t overlap in time.