MeiCam SDK For iOS  3.10.0
Instance Methods | List of all members
NvsAudioTrack Class Reference

Audio track, collection of audio clips. More...

#import <NvsAudioTrack.h>

Inheritance diagram for NvsAudioTrack:
NvsTrack NvsObject

Instance Methods

(NvsAudioClip *) - appendClip:
 Appends a clip at the end of the track. More...
 
(NvsAudioClip *) - appendClip:trimIn:trimOut:
 Appends a clip at the end of the track. More...
 
(NvsAudioClip *) - insertClip:clipIndex:
 Inserts a clip at the specified clip index on the track. More...
 
(NvsAudioClip *) - insertClip:trimIn:trimOut:clipIndex:
 Inserts a clip at the specified clip index on the track. More...
 
(NvsAudioClip *) - addClip:inPoint:
 Adds a clip. More...
 
(NvsAudioClip *) - addClip:inPoint:trimIn:trimOut:
 Add a clip in the specified duration. More...
 
(NvsAudioClip *) - appendTimelineClip:
 Appends a timeline clip at the end of the track. More...
 
(NvsAudioClip *) - appendTimelineClip:trimIn:trimOut:
 Appends a timeline clip at the end of the track. More...
 
(NvsAudioClip *) - insertTimelineClip:clipIndex:
 Inserts a timeline clip at the specified clip index on the track. More...
 
(NvsAudioClip *) - insertTimelineClip:trimIn:trimOut:clipIndex:
 Inserts a timeline clip at the specified clip index on the track. More...
 
(NvsAudioClip *) - addTimelineClip:inPoint:
 Adds a timeline clip. More...
 
(NvsAudioClip *) - addTimelineClip:inPoint:trimIn:trimOut:
 Add a timeline clip in the specified duration. More...
 
(NvsAudioClip *) - getClipWithIndex:
 Gets a clip by index. More...
 
(NvsAudioClip *) - getClipWithTimelinePosition:
 Gets a clip by the specified position of the timeline. More...
 
(NvsAudioTransition *) - setBuiltinTransition:withName:
 Sets a built-in transition. More...
 
(NvsAudioTransition *) - getTransitionWithSourceClipIndex:
 Gets the transition through the index of the source clip. More...
 
- Instance Methods inherited from NvsTrack
(int64_t) - changeInPoint:newInPoint:
 Change the in point of the clip on the timeline.If clip does not have this function authorization to return the current InPoint. If newInPoint is less than the outPoint of the previous clip, return the outPoint of the previous clip directly. If the current clip is the 0th clip, newInPoint is at least 0. This function internally calculates a new trimIn based on newInPoint and modifies the trimIn of the clip. If the new trimIn is less than 0, the corresponding Inpoint value when the trimIn is 0 will be returned; if the newInPoint is greater than trimOut, the corresponding Inpoint value of trimOut-1 will be returned. More...
 
(int64_t) - changeOutPoint:newOutPoint:
 Change the out point of the clip on the timeline.If clip does not have this function authorization to return the current outPoint.If newOutpoint is less than the outPoint of the clip, then newOutpoint will not be less than inpoint+1; if the clip is followed by nextclip, then newOutpoint will not be greater than the inpoint of nextclip. If the current clip is the last clip, the final outPoint is the duration of the timeline. If newOutpoint is greater than the outPoint of the clip, then the end of the video will be FreezeFrame. This function internally calculates a new trimOut based on newOutPoint, and removes the intermediate transition if the inPoint of the clip is not equal to the outPoint of the next clip. More...
 
(BOOL) - splitClip:splitPoint:
 Split the specified clip. More...
 
(BOOL) - removeClip:keepSpace:
 Remove the specified clip,You are not allowed to remove the opening and ending of a theme. More...
 
(BOOL) - removeRange:endTimelinePos:keepSpace:
 Remove all clips within the specified interval, and adjust the timeline in or out point if the clip only partially overlaps the interval.Failed to remove the fragment if it contains the opening and ending sections of the theme.StartTimeLinepos < 0 or endTimeLinepos <= startTimeLinepos will also remove failure. More...
 
(BOOL) - moveClip:destClipIndex:
 Move the specified clip,clipIndex and destClipIndex cannot be equal to clipCount. More...
 
(BOOL) - moveClip:targetTimelinePos:isInsertTarget:keepSpace:
 Moves the specified clip to the input position. clipIndex greater than or equal to clipCount will fail to remove, targetTimeLinePos equal to 0 will be moved to the 0 position, the theme title title will not be moved. More...
 
(BOOL) - removeAllClips
 Remove all clips. More...
 
(void) - setVolumeGain:rightVolumeGain:
 Set the volume吗,The final volume value is the track volume Multiplied by the clip volume. More...
 
(void) - getVolumeGain:rightVolumeGain:
 Get the volume, The final volume value is the track volume Multiplied by the clip volume. More...
 
- Instance Methods inherited from NvsObject
(void) - setAttachment:forKey:
 Adds an attachment to the NvsObject object to identify the object of the NvsObject or for other purposes. More...
 
(void) - setTemplateAttachment:forKey:
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
(NSObject *) - getAttachment:
 Gets attached attachments. More...
 
(NSString *) - getTemplateAttachment:
 Gets an template attachment to NvsObject. More...
 

Additional Inherited Members

- Properties inherited from NvsTrack
NvsTrackType type
 Track type. More...
 
unsigned int index
 Index of track. More...
 
int64_t duration
 Duration of track (in microseconds). More...
 
unsigned int clipCount
 Count of clips on the track. More...
 

Detailed Description

Audio track, collection of audio clips.

An audio track is an entity that holds audio clips. Multiple audio clips can be added to or removed from an audio track. An audio transition setting is required for the transition at the joint of two clips.

Note: For the meaning of interfaces and parameters of the audio track, please refer to the corresponding interface of the video track NvsVideoTrack.

Warning
In the NvsAudioTrack class, all public APIs are used in the UI thread! ! !

Method Documentation

◆ addClip:inPoint:

- (NvsAudioClip *) addClip: (NSString *)  filePath
inPoint: (int64_t)  inPoint 

Adds a clip.

Parameters
filePathThe path of file.

In IOS, there are four ways to import the path of audio and video clips:

a. Imports through the ALAssetsLibrary instance, the file path format is as follows:"assets-library://asset/asset.mov?id=E0723C86-AA47-409C-B4E2-526D7C2AA9B5&ext=mov";

b. Imports through the MPMediaQuery instance of the IPod Library, the file path format is as follows:"ipod-library://item/item.mp3?id=1217463725835578132";

c. Imports through the sand box, the file path format is as follows:"/var/mobile/Containers/Data/Documents/tmp/video20170406101714.mp4";

d. After IOS 8.0, the Photos framework replaces the ALAssetsLibrary library and is imported via the PHAset instance. The file path is as follows::"file:///var/mobile/Media/DCIM/100APPLE/IMG_0646.MP4".

Parameters
inPointThe in point of the clip on the timeline (in microseconds)
Returns
Returns the added NvsAudioClip object.
Warning
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendClip:
- insertClip:clipIndex:
- addClip:inPoint:trimIn:trimOut:

◆ addClip:inPoint:trimIn:trimOut:

- (NvsAudioClip *) addClip: (NSString *)  filePath
inPoint: (int64_t)  inPoint
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Add a clip in the specified duration.

Parameters
filePathThe path of file. For file path mode, please refer to the parameters of filePath for addClip().
inPointThe in point of the clip on the timeline (in microseconds).Note:If the value of inPoint is less than 0,the return object is null.
trimInClip trim in point (in microseconds)
trimOutClip trim out point (in microseconds)
Returns
Returns the added NvsAudioClip object.
Warning
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendClip:trimIn:trimOut:
- insertClip:trimIn:trimOut:clipIndex:
- addClip:inPoint:

◆ addTimelineClip:inPoint:

- (NvsAudioClip *) addTimelineClip: (NvsTimeline *)  timeline
inPoint: (int64_t)  inPoint 

Adds a timeline clip.

Parameters
timelineThe timeline object to be added.
inPointThe in point of the clip on the timeline (in microseconds)
Returns
Returns the added NvsAudioClip object.
Warning
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:
- insertClip:clipIndex:
- addTimelineClip:inPoint:trimIn:trimOut:

◆ addTimelineClip:inPoint:trimIn:trimOut:

- (NvsAudioClip *) addTimelineClip: (NvsTimeline *)  timeline
inPoint: (int64_t)  inPoint
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Add a timeline clip in the specified duration.

Parameters
timelineThe timeline object to be added.
inPointThe in point of the clip on the timeline (in microseconds).Note:If the value of inPoint is less than 0,the return object is null.
trimInClip trim in point (in microseconds)
trimOutClip trim out point (in microseconds)
Returns
Returns the added NvsAudioClip object.
Warning
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the added timeline duration, it will be played in the last frame
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:trimIn:trimOut:
- insertTimelineClip:trimIn:trimOut:clipIndex:
- addTimelineClip:inPoint:

◆ appendClip:

- (NvsAudioClip *) appendClip: (NSString *)  filePath

Appends a clip at the end of the track.

Parameters
filePathThe path of file. For file path mode, please refer to the parameters of filePath for addClip().Otherwise the return object is null.
Returns
Returns the appended NvsAudioClip object.
Warning
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendClip:trimIn:trimOut:
- getClipWithIndex:
- insertClip:clipIndex:

◆ appendClip:trimIn:trimOut:

- (NvsAudioClip *) appendClip: (NSString *)  filePath
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Appends a clip at the end of the track.

Parameters
filePathThe path of file. For file path mode, please refer to the parameters of filePath for addClip().Otherwise the return object is null.
trimInClip trim in point (in microseconds)
trimOutClip trim out point (in microseconds)
Returns
Returns the appended NvsAudioClip object.
Warning
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendClip:
- insertClip:trimIn:trimOut:clipIndex:
- getClipWithIndex:

◆ appendTimelineClip:

- (NvsAudioClip *) appendTimelineClip: (NvsTimeline *)  timeline

Appends a timeline clip at the end of the track.

Parameters
timelineThe timeline object to be appended.
Returns
Returns the appended NvsAudioClip object.
Warning
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:trimIn:trimOut:
- getClipWithIndex:
- insertTimelineClip:clipIndex:
Since
2.24.0

◆ appendTimelineClip:trimIn:trimOut:

- (NvsAudioClip *) appendTimelineClip: (NvsTimeline *)  timeline
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut 

Appends a timeline clip at the end of the track.

Parameters
timelineThe timeline object to be appended.
trimInClip trim in point (in microseconds)
trimOutClip trim out point (in microseconds)
Returns
Returns the appended NvsAudioClip object.
Warning
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the appended timeline duration, it will be played in the last frame
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:
- insertTimelineClip:trimIn:trimOut:clipIndex:
- getClipWithIndex:
Since
2.24.0

◆ getClipWithIndex:

- (NvsAudioClip *) getClipWithIndex: (unsigned int)  clipIndex

Gets a clip by index.

Parameters
clipIndexClip index.Note:If the value of clipIndex is more than clipCount-1 of this track ,the return object is null.
Returns
Returns the obtained NvsAudioClip object.
See also
- getClipWithTimelinePosition:
- appendClip:
- insertClip:clipIndex:

◆ getClipWithTimelinePosition:

- (NvsAudioClip *) getClipWithTimelinePosition: (int64_t)  timelinePos

Gets a clip by the specified position of the timeline.

Parameters
timelinePosThe position on the timeline (in microseconds)
Returns
Returns the obtained NvsAudioClip object.
Warning
timelinePos range(0 <= timelinePos < timeline.duration),if out of range will return null
See also
- getClipWithIndex:

◆ getTransitionWithSourceClipIndex:

- (NvsAudioTransition *) getTransitionWithSourceClipIndex: (unsigned int)  srcClipIndex

Gets the transition through the index of the source clip.

Parameters
srcClipIndexThe index of the source clip.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null.
Returns
Returns the acquired NvsAudioTransition object.
See also
- setBuiltinTransition:withName:

◆ insertClip:clipIndex:

- (NvsAudioClip *) insertClip: (NSString *)  filePath
clipIndex: (unsigned int)  clipIndex 

Inserts a clip at the specified clip index on the track.

Parameters
filePathThe path of file. For file path mode, please refer to the parameters of filePath for addClip().Otherwise the return object is null.
clipIndexThe index of the special clip.
Returns
Returns the inserted NvsAudioClip object.
Warning
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is null.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is null.
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendClip:
- getClipWithIndex:
- insertClip:trimIn:trimOut:clipIndex:

◆ insertClip:trimIn:trimOut:clipIndex:

- (NvsAudioClip *) insertClip: (NSString *)  filePath
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut
clipIndex: (unsigned int)  clipIndex 

Inserts a clip at the specified clip index on the track.

Parameters
filePathThe path of file. For file path mode, please refer to the parameters of filePath for addClip().
trimInClip trim in point(in microseconds)
trimOutClip trim out point(in microseconds)
clipIndexThe index of the special clip
Returns
Returns the inserted NvsAudioClip object.
Warning
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration,it will be played in the last frame
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is null.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is null.
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendClip:trimIn:trimOut:
- getClipWithIndex:
- insertClip:clipIndex:

◆ insertTimelineClip:clipIndex:

- (NvsAudioClip *) insertTimelineClip: (NvsTimeline *)  timeline
clipIndex: (unsigned int)  clipIndex 

Inserts a timeline clip at the specified clip index on the track.

Parameters
timelineThe timeline object to be inserted.
clipIndexThe index of the special clip.
Returns
Returns the inserted NvsAudioClip object.
Warning
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is nil.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is nil.
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:
- getClipWithIndex:
- insertTimelineClip:trimIn:trimOut:clipIndex:

◆ insertTimelineClip:trimIn:trimOut:clipIndex:

- (NvsAudioClip *) insertTimelineClip: (NvsTimeline *)  timeline
trimIn: (int64_t)  trimIn
trimOut: (int64_t)  trimOut
clipIndex: (unsigned int)  clipIndex 

Inserts a timeline clip at the specified clip index on the track.

Parameters
timelineThe timeline object to be inserted.
trimInClip trim in point(in microseconds)
trimOutClip trim out point(in microseconds)
clipIndexThe index of the special clip
Returns
Returns the inserted NvsAudioClip object.
Warning
Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the inserted timeline duration,it will be played in the last frame
If index is greater than the number of existing clips, it is added at the end.If the value of clipIndex is equal to 0, meanwhile the timeline contain themeLeader,the return object is nil.If the value of clipIndex is more or equal to the clipCount of this track, meanwhile the timeline contain themeTrailer,the return object is nil.
This interface will cause the streaming engine state to jump to the engine stopping state. For details, please refer to The Topic of Changing Engine.
See also
- appendTimelineClip:trimIn:trimOut:
- getClipWithIndex:
- insertTimelineClip:clipIndex:

◆ setBuiltinTransition:withName:

- (NvsAudioTransition *) setBuiltinTransition: (unsigned int)  srcClipIndex
withName: (NSString *)  transitionName 

Sets a built-in transition.

Parameters
srcClipIndexThe index of the source clip.Note:If the value of srcClipIndex is more than clipCount-2 of this track ,the return object is null.
transitionNameAudio transition name. Note: If users set a null string, original transition should be deleted.
Returns
Returns the NvsAudioTransition object.
Warning
The interface will cause the streaming engine status to jump to the engine stop status. For details, please refer toThe Topic of Changing Engine.
See also
- getTransitionWithSourceClipIndex:

The documentation for this class was generated from the following file: