Contact us
tel:15797766463
mail:business@seeshiontech.com
Update time : 2020-08-14 10:53:16
SXAudioItem is similar to SXTrack but there is no need to add it to any group. It is managed by SXEditManager directly.
//example:
SXAudioItem *audioItem = [_editManager createAudioItem:musicPath inPoint:inPoint];
if (audioItem) {
}
// The start time and end time of the audio track.
@property (nonatomic, assign) float startTime;
/// The insertion time of audio track.
@property (nonatomic, assign) float inPoint;
/// The duration of audio track.
@property (nonatomic, assign) float duration;
/// Volume.
@property (nonatomic, assign) float gain;
/// Fade-in duration.
@property (nonatomic, assign) float fadeIn;
/// Fade-out duration.
@property (nonatomic, assign) float fadeOut;
/// The speed coefficient.
@property (nonatomic, assign) float speed;
/// The coefficient of changing tone.
@property (nonatomic, assign) float pitch;
/// Loop or not.
@property (nonatomic, assign) BOOL loop;
A. SXAudioThumbnailCache SXAudioThumbnailCache will manage the data of audio waves to be drawn based on the path.
Initialization. The parameter is the number of cache, which represents the number of path to cache the audio waves at the same time. If the number of path is over the number of cache, it will fail to get the audio waves.
Remove audio caches. Note that cache management depends on the cache path, and do not delete the path from the cache if there is still audio of the same path being drawn.
B. SXAudioThumbnail The image data can be gotten via audio path.
_thumbnail = [[SXAudioThumbnail alloc] initWithPath:_model.audioItem.filePath cache:_audioCache singleSamples:512];
_thumbnail.delegate = self;
- (NSArray *)getThumbDataStartTime:(NSTimeInterval)startTime duration:(NSTimeInterval)duration;