DEV Community

Cover image for Day 14: Youtube Voice Search with Python
Dilek Karasoy for Picovoice

Posted on

1

Day 14: Youtube Voice Search with Python

Have you ever been in a situation where you are going back and forth in a YouTube video. podcast or a movie searching for a specific phrase? No more. Meet OctoTube: It's like Google Search for entire YouTube video content, not just text-based keywords

Get Started
Clone the Octopus GitHub repository:

git clone --recurse-submodules https://github.com/Picovoice/octopus.git
Enter fullscreen mode Exit fullscreen mode

Run this from the root of the repository to install Python dependencies:

pip3 install -r demo/youtube/requirements.txt
Enter fullscreen mode Exit fullscreen mode

It's day 14, you probably have your AccessKey but if not get your AccessKey from Picovoice Console

Find a video on YouTube you like to search and from the root of the repository run:

python3 demo/youtube/octotube.py \
--access-key ${ACCESS_KEY} \
--url ${YOUTUBE_VIDEO_URL} \
--phrases ${SEARCH_PHRASE0} ${SEARCH_PHRASE1}
Enter fullscreen mode Exit fullscreen mode

You should get something like the below

indexed 3024 seconds of audio in 54.36 seconds
searched 3024 seconds of audio for 1 phrases in 0.01013 seconds
pied piper >>>
[0.5] https://www.youtube.com/watch?v=Lt6PPiTTwbE&t=784
[1.0] https://www.youtube.com/watch?v=Lt6PPiTTwbE&t=840
[1.0] https://www.youtube.com/watch?v=Lt6PPiTTwbE&t=2355
[1.0] https://www.youtube.com/watch?v=Lt6PPiTTwbE&t=2940
Enter fullscreen mode Exit fullscreen mode

Indexing is the bulk of the processing time. The good news is once the video is indexed, it is super fast to search for more.

searched 3024 seconds of audio for 1 phrases in 0.00655 seconds
jian yang >>>
[0.3] https://www.youtube.com/watch?v=Lt6PPiTTwbE&t=1332
[0.7] https://www.youtube.com/watch?v=Lt6PPiTTwbE&t=2478
Enter fullscreen mode Exit fullscreen mode

How Does it Work?
OctoTube uses the Octopus Speech-to-Index engine. Octopus directly indexes audio without relying on a text representation.

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

πŸ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay