• This repository has been archived on 27/Mar/2024
  • Stars
    star
    962
  • Rank 47,540 (Top 1.0 %)
  • Language
    Python
  • License
    MIT License
  • Created over 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Creates audio supercuts.

Audiogrep

Audiogrep transcribes audio files and then creates "audio supercuts" based on search phrases. It uses CMU Pocketsphinx for speech-to-text and pydub to stitch things together.

Here's some sample output.

Requirements

Install using pip

pip install audiogrep

Install ffmpeg with Ogg/Vorbis support. If you're on a mac with homebrew you can install ffmpeg with:

brew install ffmpeg --with-libvpx --with-libvorbis

Finally, install CMU Pocketsphinx. For mac users I followed these instructions to get it working:

brew tap watsonbox/cmu-sphinx
brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxbase
brew install --HEAD watsonbox/cmu-sphinx/cmu-sphinxtrain # optional
brew install --HEAD watsonbox/cmu-sphinx/cmu-pocketsphinx

How to use it

First, transcribe the audio (you'll only need to do this once per audio track, but it can take some time)

# transcribes all mp3s in the selected folder
audiogrep --input path/to/*.mp3 --transcribe

Then, basic use:

# returns all phrases with the word 'word' in them
audiogrep --input path/to/*.mp3 --search 'word'

The previous example will extract phrase chunks containing the search term, but you can also just get individual words:

audiogrep --input path/to/*.mp3 --search 'word' --output-mode word

If you add the '--regex' flag you can use regular expressions. For example:

# creates a supercut of every instance of the words "spectre", "haunting" and "europe"
audiogrep --input path/to/*.mp3 --search 'spectre|haunting|europe' --output-mode word --regex

You can also construct 'frankenstein' sentences (mileage may vary):

# stupid joke
audiogrep --input path/to/*.mp3 --search 'my voice is my passport' --output-mode franken

Or you can just extract individual words into files.

# extracts each individual word into its own file in a directory called 'extracted_words'
audiogrep --input path/to/*.mp3 --extract

Exporting to: extracted_words/i.mp3
Exporting to: extracted_words/am.mp3
Exporting to: extracted_words/the.mp3
Exporting to: extracted_words/key.mp3
Exporting to: extracted_words/master.mp3

Options

audiogrep can take a number of options:

--input / -i

mp3 file or pattern for input

--output / -o

Name of the file to generate. By default this is "supercut.mp3"

--search / -s

Search term

--output-mode / -m

Splice together phrases, single words, fragments with wildcards, or "frankenstein" sentences. Options are:

  • sentence: (this is the default)
  • word
  • fragment
  • franken

--padding / -p

Time in milliseconds to add between audio segments. Default is 0.

--crossfade / -c

Time in milliseconds to crossfade audio segments. Default is 0.

--extract / -x

--demo / -d

Show the results of the search without outputing a file

Troubleshooting

If you receive the error "ERROR: "cmd_ln.c", line 942: Unknown argument: -alignctl", uninstalling and reinstalling cmu-sphinxbase and cmu-pocketsphinx may solve the issue.

More Repositories

1

videogrep

automatic video supercuts with python
Python
3,186
star
2

ffmpeg-explorer

Create and render complex ffmpeg filtergraphs in the browser.
Svelte
415
star
3

patent-generator

Transforms literary/philosophical texts into patent applications
Python
352
star
4

p5.riso

A p5js library for risograph printing by Sam Lavigne and Tega Brain.
JavaScript
299
star
5

zoom-escaper

a simple tool to help you escape zoom meetings by making your presence unbearable to others
Vue
197
star
6

vidpy

video editing and compositing with python and melt
Python
127
star
7

camera-motion-detector

Uses opencv to detect when a camera is panning or zooming.
Python
92
star
8

sfpc-scrapism

7-week class at SFPC, Fall 2018
Python
84
star
9

scrapism-spring-2022

Python
84
star
10

p5.gif.js

let's you play gifs in p5
JavaScript
83
star
11

scrapism

a work-in-progress guide to web scraping as an artistic and critical practice
Python
78
star
12

flickr-scrape

Python
63
star
13

automating-video-itp

A 6 week class at ITP NYU
61
star
14

p5.patgrad

a p5.js library for adding gradients and repeating patterns to your sketches
JavaScript
58
star
15

prison_fax

Python
57
star
16

p5.vscode

A VS Code extension to generate new p5.js project files.
TypeScript
53
star
17

detourning-the-web

Syllabus and example code for 7-week class at NYU/ITP
Python
47
star
18

zoom-deleter

deletes zoom and prevents you from reinstalling it
Go
44
star
19

detourning-the-web-2018

Python
39
star
20

infinite-video-fall-2023

Syllabus and materials for "Infinite Video" a 10-week course at the School for Poetic Computation
Python
38
star
21

servi.js

JavaScript
36
star
22

automating-video

Two-day workshop for SFPC
30
star
23

scrapism-fall-2022

Syllabus for Scrapism @ SFPC / Fall 2022
Python
27
star
24

internet-as-form

JavaScript
27
star
25

other-orders

experiments in sorting
Python
25
star
26

sfpc-scrapism-spring-2019

Python
22
star
27

enron-email-archive

The front end for http://archive.enron.email
CSS
18
star
28

autotv

Automatically generated television (draft)
Python
18
star
29

servi-ide

JavaScript
15
star
30

slow-hot-computer

makes your computer slow, and hot, so you can be less productive.
JavaScript
15
star
31

get-well-soon

code for "Get Well Soon"
Python
13
star
32

mask-generator

Generates masks you can print out, cut and wear from images of faces.
Python
13
star
33

youtubegrep

makes supercuts from youtube searches (alpha)
Python
12
star
34

interrogating-dating-pioneer-works

11
star
35

semantic-searcher

command line semantic text search tool
Python
11
star
36

stupidhackathon

stupid shit no one needs and terrible ideas hackathon
HTML
10
star
37

LazyCoin

A new currency that stores non-value.
TeX
10
star
38

websocket-p5

JavaScript
9
star
39

AynRandom

ayn random twitter bot
Python
9
star
40

portfolio-generator

Python
9
star
41

automating-video-lang

8
star
42

webscrape_tutorial

Python
8
star
43

new-york-apartment

Python
6
star
44

processing.riso

Java
6
star
45

videogrep-gui

Python
6
star
46

noflyzone

Python
5
star
47

code-poetry-2017

5
star
48

stocktalk

Generate video/gif messages using stock footage
JavaScript
5
star
49

dynamicweb-2017

HTML
5
star
50

p5-ide

an IDE for p5.js
JavaScript
4
star
51

supercut-sonic-acts-workshop

Supercut workshop for Sonic Acts, June 2022
4
star
52

videosonnet

Processing
4
star
53

creatures

JavaScript
4
star
54

p5-gif-example

A simple example showing how to save animated gifs from p5.js sketches
JavaScript
3
star
55

piplayer

A (relatively) simple utility for setting up a raspberry pi as a video player.
Python
3
star
56

inventories-lists-catalogs

2-day workshop at Pioneer Works
3
star
57

zuckify

zuckifies things
JavaScript
3
star
58

occupied-bnb

code and resources for https://lav.io/occupied_bnb
HTML
3
star
59

popcorn-exporter

python server that creates mp4s from popcorn js compositions
Python
3
star
60

p5_tutorial

processing to p5.js examples
JavaScript
3
star
61

streeteasy-scrape

scrape streeteasy with selenium
Python
3
star
62

contract_generator

transform literary texts into legal contracts
Python
3
star
63

yt-vid-grid

JavaScript
3
star
64

yale-vid-workshop-2024

Python
3
star
65

voice_puppet

Python
3
star
66

vidquery

Python
3
star
67

smelldating

HTML
2
star
68

darkgenius

text annotation
JavaScript
2
star
69

scenegraphhh

C++
2
star
70

the-capitalist-gene

HTML
2
star
71

carbon-offset-scraper

Python
2
star
72

onhell

HTML
2
star
73

synthetic-messenger-performance

CSS
2
star
74

climate-clock

Python
2
star
75

notes-on-police-funding

Jupyter Notebook
2
star
76

greetings

Greetings Fellow Alienated Subject of Late Capitalism
HTML
2
star
77

snail-chat-4

JavaScript
2
star
78

waves

JavaScript
2
star
79

offset-archive

An archive of carbon credit schemes and sales
Jupyter Notebook
1
star
80

creative-ml-fall-2024

1
star
81

webdev-2017

CSS
1
star
82

oddjobs

HTML
1
star
83

text-masher

Python
1
star
84

ffx9subs

Python
1
star
85

case-study

A tool for the military to analyze literary and philosophical texts
JavaScript
1
star
86

baabaa

JavaScript
1
star
87

interaction1-spring2020

HTML
1
star
88

goldstein-lit

analyzes literature using the goldstein scale
JavaScript
1
star
89

internet-as-form-2020

HTML
1
star
90

scraping-text-workshop

Python
1
star
91

suspicious-camera

A camera rig with personality
Processing
1
star
92

creepy-controller

a processing sketch to control axis cameras
Processing
1
star