MeiCam SDK For Web  3.12.1
Public Member Functions | List of all members
NvsAudioTrack Class Reference

Audio track, a collection of audio clips. An audio track is an entity that holds audio clips. Each audio track can add or remove multiple audio clips. When playing one audio clip to another, you need to set the audio transition to facilitate the transition. Note: for a series of interfaces of audio track and the meaning of its parameters, please refer to the corresponding interface of Nvsvideotrack. More...

Inheritance diagram for NvsAudioTrack:
NvsTrack NvsProjObj

Public Member Functions

 constructor ()
 
 insertClip (audioFilePath, insertPoint)
 Inserts a clip at the specified clip index on the track. This interface will cause the streaming engine state to jump to the engine stop state. More...
 
 insertClip2 (audioFilePath, trimIn, trimOut, insertPoint)
 Inserts clip at the specified clip index on the track. This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details. More...
 
 appendClip (audioFilePath)
 Appends a clip at the end of the track. More...
 
 appendClip2 (audioFilePath, trimIn, trimOut)
 append clip More...
 
 addClip (audioFilePath, inPoint)
 Adds audio clip. More...
 
 addClip2 (audioFilePath, inPoint, trimIn, trimOut)
 Adds audio clip. This interface causes the streaming engine state to jump to the engine stop state. More...
 
 addClipWithSpeedExt (audioFilePath, inPoint, outPoint, speed, keepAudioPitch)
 Add clip with speed. More...
 
 addClipWithSpeedExt2 (audioFilePath, inPoint, outPoint, trimIn, trimOut, speed, keepAudioPitch)
 Add clip with speed. More...
 
 getClipByIndex (index)
 Gets clip by index. More...
 
 getClipByTimelinePosition (timelinePos)
 Gets clip by time. More...
 
 setBuiltinTransition (srcClipIndex, transitionName)
 Sets built-in transition. More...
 
 getTransitionBySourceClipIndex (srcClipIndex)
 Get transition by source clip index. More...
 
- Public Member Functions inherited from NvsTrack
 constructor ()
 NvsFx constructor.
 
 getType ()
 Get track type. More...
 
 getIndex ()
 Gets track index. More...
 
 getDuration ()
 Gets track length. More...
 
 getClipCount ()
 Gets the number of clips on the track. More...
 
 changeInPoint (clipIndex, newInPoint)
 Modifies the clip's in-point on 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...
 
 changeOutPoint (clipIndex, newOutPoint)
 Modifies the clip's out-point on 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...
 
 splitClip (clipIndex, splitPoint)
 Splits the specified clip. More...
 
 removeClip (clipIndex, keepSpace)
 Removes the specified clip.You are not allowed to remove the opening and ending of a theme. More...
 
 removeRange (startTimelinePos, endTimelinePos, keepSpace)
 Removes all clips within the specified interval, and adjust the timeline in-point or out-point if the clip only partially overlaps the 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...
 
 moveClip (sourceClipIndex, targetClipIndex)
 Moving the specified clip, swapping the two positions of the input, affects the arrangement of the clip on the timeline.,clipIndex and destClipIndex cannot be equal to clipCount. More...
 
 moveClipByPositions (sourceClipIndex, 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...
 
 removeAllClips ()
 Removes all the clips. More...
 
 setVolumeGain (leftVolumeGain, rightVolumeGain)
 Sets the volume. The final volume value is the track volume Multiplied by the clip volume. More...
 
 getVolumeGain ()
 Get the volume information. The final volume value is the track volume Multiplied by the clip volume. More...
 
- Public Member Functions inherited from NvsProjObj
 constructor ()
 
 setInternalObject (obj)
 set internal object More...
 
 getInternalObject ()
 get internal object More...
 
 setTemplateAttachment (key, value)
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
 getTemplateAttachment (key)
 Gets an template attachment to NvsObject. More...
 

Detailed Description

Audio track, a collection of audio clips. An audio track is an entity that holds audio clips. Each audio track can add or remove multiple audio clips. When playing one audio clip to another, you need to set the audio transition to facilitate the transition. Note: for a series of interfaces of audio track and the meaning of its parameters, please refer to the corresponding interface of Nvsvideotrack.

Member Function Documentation

◆ addClip()

NvsAudioTrack::addClip (   audioFilePath,
  inPoint 
)
inline

Adds audio clip.

Parameters
{String}audioFilePath Audio clip path
{Number}inPoint The in point on the timeline to insert the audio clip (in microseconds)
Returns
{NvsAudioClip} Returns the added audio clip object. Parameter inPoint range: [0 , timeline.getDuration())This interface will cause the streaming engine state to jump to the engine stop state.

◆ addClip2()

NvsAudioTrack::addClip2 (   audioFilePath,
  inPoint,
  trimIn,
  trimOut 
)
inline

Adds audio clip. This interface causes the streaming engine state to jump to the engine stop state.

Parameters
{String}audioFilePath audio file path
{Number}inPoint The in point of the audio clip to be inserted on the timeline (in microseconds)
{Number}trimIn Trim in point of audio clip (in microseconds)
{Number}trimOut Trim out point of audio clip (in microseconds)
Returns
{NvsAudioClip} Returns the added audio clip object. Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame.

◆ addClipWithSpeedExt()

NvsAudioTrack::addClipWithSpeedExt (   audioFilePath,
  inPoint,
  outPoint,
  speed,
  keepAudioPitch 
)
inline

Add clip with speed.

Parameters
{String}audioFilePath audio file path
{Number}inPoint in point
{Number}outPoint out point
{Number}speed speed
{Boolean}keepAudioPitch keep audio pitch
Returns
{NvsAudioClip}

◆ addClipWithSpeedExt2()

NvsAudioTrack::addClipWithSpeedExt2 (   audioFilePath,
  inPoint,
  outPoint,
  trimIn,
  trimOut,
  speed,
  keepAudioPitch 
)
inline

Add clip with speed.

Parameters
{String}audioFilePath audio file path
{Number}inPoint in point
{Number}outPoint out point
{Number}trimIn trim in
{Number}trimOut trim out
{Number}speed speed
{Boolean}keepAudioPitch keep audio pitch
Returns
{NvsAudioClip}

◆ appendClip()

NvsAudioTrack::appendClip (   audioFilePath)
inline

Appends a clip at the end of the track.

Parameters
{String}audioFilePath Audio clip path.
Returns
{NvsAudioClip} Returns the appended audio clip object. This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details.

◆ appendClip2()

NvsAudioTrack::appendClip2 (   audioFilePath,
  trimIn,
  trimOut 
)
inline

append clip

Parameters
{String}audioFilePath Audio clip path
{Number}trimIn Trim in point (in microseconds)
{Number}trimOut Trim out point (in microseconds)
Returns
{NvsAudioClip} Returns the appended audio clip object. This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details.

◆ constructor()

NvsAudioTrack::constructor ( )
inline

@constructor

◆ getClipByIndex()

NvsAudioTrack::getClipByIndex (   index)
inline

Gets clip by index.

Parameters
{Number}index Clip index
Returns
{NvsAudioClip} Returns the obtained audio clip object. Parameter index range(0 <= clipIndex < getClipCount()),if out of range will return NULL.

◆ getClipByTimelinePosition()

NvsAudioTrack::getClipByTimelinePosition (   timelinePos)
inline

Gets clip by time.

Parameters
{Number}timelinePos Position on the timeline (in microseconds).
Returns
{NvsAudioClip} Returns the obtained audio clip object. Parameter timelinePos range(0 <= timelinePos < timeline.getDuration()),if out of range will return NULL.

◆ getTransitionBySourceClipIndex()

NvsAudioTrack::getTransitionBySourceClipIndex (   srcClipIndex)
inline

Get transition by source clip index.

Parameters
{Number}srcClipIndex Source clip index of the transition. Range [0 , getClipCount())
Returns
{NvsAudioTransition} Returns the acquired NvsAudioTransition object.

◆ insertClip()

NvsAudioTrack::insertClip (   audioFilePath,
  insertPoint 
)
inline

Inserts a clip at the specified clip index on the track. This interface will cause the streaming engine state to jump to the engine stop state.

Parameters
{String}audioFilePath Clip path.For the clip path type, please refer to the parameter filePath of the NvsVideoTrack interface addClip()
{Number}insertPoint Clip index to insert at
Returns
{NvsAudioClip} Returns the inserted audio clip object. 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 getClipCount() of this track, meanwhile the timeline contain themeTrailer,the return object is NULL

◆ insertClip2()

NvsAudioTrack::insertClip2 (   audioFilePath,
  trimIn,
  trimOut,
  insertPoint 
)
inline

Inserts clip at the specified clip index on the track. This interface will cause the streaming engine state to jump to the engine stop state, please refer to Engine Change Feature for details.

Parameters
{String}audioFilePath clip path. For the clip path type, please refer to the parameter filePath of the NvsVideoTrack interface addClip()
{Number}trimIn Trim in point (in microseconds)
{Number}trimOut Trim out point (in microseconds)
{Number}insertPoint Clip index to insert at.
Returns
{NvsAudioClip} Returns the inserted audio clip object. Parameters need to meet (0 <= trimIn < trimOut). If trimOut is bigger than the file original duration, it will be played in the last frame.

◆ setBuiltinTransition()

NvsAudioTrack::setBuiltinTransition (   srcClipIndex,
  transitionName 
)
inline

Sets built-in transition.

Parameters
{Number}srcClipIndex Source clip index of the transition. Range [0 , getClipCount())
{String}transitionName Audio transition name. Note: Currently audio transition only supports Fade mode; if it is set to null string, the original transition will be deleted
Returns
{NvsAudioTransition} Returns audio transition object. This interface will cause the streaming engine state to jump to the engine stop state

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