Skip to content

Commit 57257eb

Browse files
committed
Update read&write.md with video and audio file handling
1 parent eacfe70 commit 57257eb

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/getting_started/read&write.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ Other clip type inherent it from the `VideoClip`.
2020
```python
2121
import vidiopy
2222
video = vidiopy.VideoFileClip("path/to/video.extension")
23-
video.write_videofile("path/to/output/video.extension", fps=30)
23+
video.write_videofile("path/to/output/video.extension", fps=30) # fps is optional it will default use the fps of the video if it is set
24+
```
25+
26+
## Reading Audio from file
27+
28+
To read the audio from the file we can use the `AudioFileClip` class. This class takes the path of the audio file as input and returns a audio which inherits from `AudioClip` class.
2429

30+
```python
31+
import vidiopy
32+
audio = vidiopy.AudioFileClip("path/to/audio.extension")
33+
```
34+
35+
## Writing Audio to file
36+
37+
To Write the Audio we can use the `write_audiofile` function inside the `AudioClip`.
38+
Other clip type inherent it from the `AudioClip`.
39+
40+
```python
41+
import vidiopy
42+
audio = vidiopy.AudioFileClip("path/to/audio.extension")
43+
audio.write_audiofile("path/to/output/audio.extension")
2544
```

0 commit comments

Comments
 (0)