Statics
Functions
Closes a given audio sink. Once a sink is closed it can no longer receive additional samples.
Deallocates an audio sink.
Allocates a new audio sink ready to receive audio samples.
Send audio samples to given sink. Samples should be 16-bit signed little-endian
mono and match the sample rate returned by alass_audio_sink_sample_rate()
.
The sample rate expected by this audio sink (usually either 8kHz or 16kHz).
Determines whether the given subtitle is able to be synced
Configure logging
Deallocates options instance
Logs the values of the given options instance (useful for debugging)
Creates a new options instance initialized to default values
Whether attempt correction of mismatched framerates
Sets the alass
“interval” parameter
Sets the alass
“speed_optimization” parameter
Sets the alass
“split_mode” parameter
The alass
“split_penalty” parameter
Performs alass
subtitle synchronization.
Computes timespans given detected voice-activity.
Deallocates timespans buffer.
Loads cached timespans from disk (see alass_timespans_save_raw()
). Returns
null if no file exists at the given path.
Loads timespans from subtitle file. Returns null if no file exists at the given path.
Creates a new timespans buffer ready to accept data (see alass_timespans_push()
).
Appends timespan to buffer. Start and end times are in milliseconds.
Saves timespans to disk with the given filename
(see alass_timespans_load_raw()
).
[EXPERIMENTAL] Cleans voice-activity data
Computes voice activity given an audio sink containing sample data.
Deallocates voice activity buffer.
Copies the contents of a char buffer into an owned String
instance. Will return None
if the pointer is null
, or if
the C string is not a valid UTF-8 sequence.
Dereferences a heap pointer and returns a mutable reference, ensuring
the value will not be dropped when it goes out of scope. Useful for
working with heap values recieved from accross an ffi boundary without
dropping them when finished. Panics if pointer is null
.
Dereferences a heap pointer and returns a boxed instance. Because
the returned value is owned, it will be dropped when it goes
out of scope. Useful for deallocating heap values received from
accross an ffi boundary. Panics if pointer is null
.
Safe version of from_ptr
which, if pointer is null
, will
return None
instead of panicking.
Moves an instance to the heap and returns it’s pointer. Value will not be dropped when the return value leaves scope. Useful for leaking values to be sent across an ffi boundary.