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

83 lines
1.8 KiB

3 years ago
# Audio Decode Implementation With PyAV
3 years ago
3 years ago
*author: Junjie Jiang*
<br />
### Description
3 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.
3 years ago
3 years ago
<br />
3 years ago
3 years ago
### Code Example
3 years ago
```Python
from towhee import pipe, ops, DataCollection
3 years ago
2 years ago
p = (
pipe.input('audio_file')
.flat_map('audio_file', 'frame', ops.audio_decode.ffmpeg())
.output('frame')
)
2 years ago
DataCollection(p('./music.mp3')).show(limit=1)
3 years ago
```
3 years ago
3 years ago
![img](./img.png)
3 years ago
3 years ago
<br />
3 years ago
3 years ago
### Factory Constructor
3 years ago
Create the operator via the following factory method:
3 years ago
***audio_decode.ffmpeg()***
3 years ago
3 years ago
3 years ago
<br />
3 years ago
### Interface
3 years ago
An audio decode operator takes an audio file path as input. It decodes the audio back to audio frames.
3 years ago
**Args:**
3 years ago
**audio** (str):
3 years ago
Audio file path.
3 years ago
**Return** (generator):
3 years ago
An generator over audio frames with type `towhee.types.AudioFrame`.
3 years ago
# More Resources
- [Scalar Quantization and Product Quantization - Zilliz blog](https://zilliz.com/learn/scalar-quantization-and-product-quantization): A hands-on dive into scalar quantization (integer quantization) and product quantization with Python.
- [Vector Database Use Case: Audio Similarity Search - Zilliz](https://zilliz.com/vector-database-use-cases/audio-similarity-search): Building agile and reliable audio similarity search with Zilliz vector database (fully managed Milvus).
- [Real-Time GenAI without Hallucination Using Confluent & Zilliz Cloud](https://zilliz.com/product/integrations/confluent): nan
- [Audio Retrieval Based on Milvus - Zilliz blog](https://zilliz.com/blog/audio-retrieval-based-on-milvus): Create an audio retrieval system using Milvus, an open-source vector database. Classify and analyze sound data in real time.