From Resources
VideoEditor SDK supports loading audio files from the resources.
Add audio assets to AssetConfig
#
AssetConfig
#To use the audio clips, they must first be available in the SDK's backend. This is done by adding the audio assets to the AssetConfig
.
The AudioTrackAsset
takes in a unique identifier, an AudioSource
, and optionally the title, artist, and duration in seconds.
Note that the AudioSource
class is not optimized to handle remote resources, see next section on how to handle loading audio clips from remote resource.
Create categories#
We then add the audio clips to an AudioTrackCategoryItem
object that holds the metadata of the category such as a unique identifier, title, and optionally a preview image.
The AudioTrackItem
uses the same identifier as the one specified when creating the corresponding AudioTrackAsset
. It also optionally takes an ImageSource
that is used to display its thumbnail.
Configure UiConfigAudio
#
UiConfigAudio
#Here, we configure UiConfigAudio
and set the audio track lists.