Module audio_accessor
Provide implementation for AudioAccessor functions.
Info:
- License: MIT
- Author: Nomad Monad
-
AudioAccessor:new (audio_accessor)
-
Create new AudioAccessor instance.
Parameters:
- audio_accessor
userdata. The pointer to audio accessor
Returns:
table AudioAccessor instance
-
AudioAccessor:log (...)
-
Log messages with the AudioAccessor logger.
Parameters:
- ...
(varargs) Messages to log.
-
AudioAccessor:state_changed ()
-
State Changed. Wraps AudioAccessorStateChanged.
Returns true if the underlying samples (track or media item take) have changed,
but does not update the audio accessor, so the user can selectively call
AudioAccessorValidateState only when needed.
Returns:
boolean
-
AudioAccessor:update ()
-
Update. Wraps AudioAccessorUpdate.
Force the accessor to reload its state from the underlying track or media item
take.
-
AudioAccessor:validate_state ()
-
Validate State. Wraps AudioAccessorValidateState.
Validates the current state of the audio accessor -- must ONLY call this from
the main thread. Returns true if the state changed.
Returns:
boolean
-
AudioAccessor:destroy ()
-
Destroy. Wraps DestroyAudioAccessor.
Destroy an audio accessor. Must only call from the main thread.
-
AudioAccessor:get_end_time ()
-
Get End Time. Wraps GetAudioAccessorEndTime.
Get the end time of the audio that can be returned from this accessor.
Returns:
number
-
AudioAccessor:get_samples (samplerate, num_channels, start_time_sec, samples_per_channel, sample_buffer)
-
Get Samples. Wraps GetAudioAccessorSamples.
Get a block of samples from the audio accessor. Samples are extracted
immediately pre-FX, and returned interleaved (first sample of first channel,
first sample of second channel...). Returns 0 if no audio, 1 if audio, -1 on
error.
Parameters:
- samplerate
number
- num_channels
number
- start_time_sec
number
- samples_per_channel
number
- sample_buffer
userdata (reaper.array). A block of samples from the audio accessor.
Returns:
number
-
AudioAccessor:get_start_time ()
-
Get Start Time. Wraps GetAudioAccessorStartTime.
Get the start time of the audio that can be returned from this accessor.
Returns:
number