In this default mode, the duration of the audio item on a track will simply
follow the audio file's durationSeconds
property. durationSeconds
defaults to the length of the source file, so if no custom
durationSeconds
is specified on an audio file, Basic
mode will function
similarly to OneShot
mode.
// Create an AudioFile technique that truncates playback after 0.5 seconds
const tambourine = new fluid.techniques.AudioFile({
mode: fluid.AudioFileMode.Basic
path: '/tambourine.wav',
info: { duration: 1.234 } // specifies source file length in seconds
durationSeconds: 0.5, // stop playback after 0.5 seconds
fadeOutSeconds: 0.1,
})
In this mode, the audio item length will be taken from the UseContext's
durationSeconds
property. As a result, when using session.insertScore
,
a '1234'
rhythm string, combined with a 't...'
pattern string will
trim the length of the inserted audio file to a quarter note.
const tambourine = new fluid.techniques.AudioFile({ path: '/tambourine.wav', info: { duration: 1.234 } })
tambourine.mode = fluid.AudioFileMode.Event
session.insertScore({
tLibrary: { t: tambourine )},
r '1234',
drums: 't.t.',
})
The OneShot mode plays the file to its conclusion, ignoring the event length extracted from the pattern string
Play the audio file to its conclusion, OR fade it out at the onset of the next AudioFile in the clip (whichever happens first)
AudioFile playback modes