Skip to content

Commit

Permalink
Update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
levantAJ committed Oct 17, 2020
1 parent 049c1e6 commit bf8e3a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ import VideoEditor
1: Prepare the source video asset.

```swift
let videoAsset = VideoEditor.Asset(localURL: yourVideoLocalURL, volume: 1, startTime: .zero, duration: videoDuration)
let videoAsset = VideoEditor.Asset(localURL: yourVideoLocalURL, volume: 1)
```
- With `volume`, you can able to adjust to volume of video in 0...1

2: Prepare the audios

Expand All @@ -44,6 +45,10 @@ let firstAudioAsset = VideoEditor.Asset(localURL: firstAudioLocalURL, volume: 0.
let secondAudioAsset = VideoEditor.Asset(localURL: secondAudioLocalURL, volume: 0.7, startTime: CMTime(seconds: 2, preferredTimescale: CMTimeScale(NSEC_PER_SEC)), duration: secondAudioDuration)
```

- `startTime` is the point of time that you wanna add your audio into the final video, e.g. add set `startTime` as `CMTime(seconds: 3, preferredTimescale: CMTimeScale(NSEC_PER_SEC))` to tell engine to start add this audio from the third second of the final video.

- `duration` indicates how long the audio will be added into the final video from the `startTime`. Usually set it equal to the audio asset duration. Set `nil` to tell the `duration` is its duration.

3: Start to merge

```swift
Expand Down
4 changes: 2 additions & 2 deletions VideoEditor/VideoEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public extension VideoEditor {
/// - Parameters:
/// - localURL: The asset local URL
/// - volume: Volume of the asset will be adjusted to the final video
/// - startTime: The start time of the asset in the final video
/// - duration: The duration of the asset will be added into the final video
/// - startTime: The point of time that you wanna add your audio into the final video, e.g. add set `startTime` as `CMTime(seconds: 3, preferredTimescale: CMTimeScale(NSEC_PER_SEC))` to tell engine to start add this audio from the third second of the final video.
/// - duration: Indicates how long the audio will be added into the final video from the `startTime`. Usually set it equals to the audio's duration. Set `nil` to tell the `duration` is its duration.
public init(localURL: URL, volume: Float = 1,
startTime: CMTime = .zero, duration: CMTime? = nil) {
self.localURL = localURL
Expand Down

0 comments on commit bf8e3a5

Please sign in to comment.