logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

76 lines
939 B

2 years ago
# Audio Decode Implementation With PyAV
2 years ago
2 years ago
*author: Junjie Jiang*
<br />
### Description
2 years ago
**Audio** **Decode** converts the encoded audio back to uncompressed audio frames. In most cases, audio decoding is the first step of an audio processing pipeline.
2 years ago
2 years ago
<br />
2 years ago
2 years ago
### Code Example
2 years ago
```Python
from towhee import pipe, ops, DataCollection
2 years ago
1 year ago
p = (
pipe.input('audio_file')
.flat_map('audio_file', 'frame', ops.audio_decode.ffmpeg())
.output('frame')
)
1 year ago
DataCollection(p('./music.mp3')).show(limit=1)
2 years ago
```
2 years ago
2 years ago
![img](./img.png)
2 years ago
2 years ago
<br />
2 years ago
2 years ago
### Factory Constructor
2 years ago
Create the operator via the following factory method:
2 years ago
***audio_decode.ffmpeg()***
2 years ago
2 years ago
2 years ago
<br />
2 years ago
### Interface
2 years ago
An audio decode operator takes an audio file path as input. It decodes the audio back to audio frames.
2 years ago
**Args:**
2 years ago
**audio** (str):
2 years ago
Audio file path.
2 years ago
**Return** (generator):
2 years ago
An generator over audio frames with type `towhee.types.AudioFrame`.
2 years ago