Similar to Adobe Audition
, this project will check the audio information quickly inside of terminal.
Python library can be installed with pip install -r requrements.txt
.
Terminal library: ffmpeg
, sox
.
There are several options:
T-IMG
library can be found at timg and install;Terminal Image Viewer (TIV)
library can be found at tiv and install (optional);
Simple script will learn.
python see.py <input_file>
input_file
is the path of input audio file as long as program will recognize;
two numbers
: starting time & ending time;- example:
10 20
means to split audio from10s
to20s
; - time support in
hms
format, such as:1h2m3.4s
- example:
- empty string
''
(press return without input): plot last generated graphics; p
: play last analyzed audio;pp
: play the partition of audio where used for analyzers;
q
: quit program;r
: reset starting and ending time;m
: change themode
of showing graphics; there are several modes can be changed;fft
andfbank
changes they
axis transform;power
andlog
change the color density (spectral values) transform of graphics;mono
andstereo
change the channel number to be1
ornot 1
if have;spectral
andentropy
: to plot spectral or Shannon's entropy;color
andnocolor
: some analyzer will be colorful by its pitch or not;- example:
m fft
means switch tofft
mode;
nonlinear
: simulate the nonlinear effect due to the physical structure of ear/cochlea when hearing a very loud sound;number
: nonlinear coefficient (sound louder, number will be larger);- example:
nonlinear 5
will transform audio into nonlinear form at the parameter of5
;
sr
: change the sample rate of showing audio;- example:
sr 16000
means switch to16000Hz
sample rate;
- example:
fr
: change the video frame rate for analyzer;- example:
fr 30
means switch to30Hz
video frame rate;
- example:
o
: change the input audio file path;- example:
o demo/june.ogg
oro "demo/june.ogg"
means change input audio file todemo/june.ogg
;
- example:
h
: to printREADME.md
file (this file) ashelp
;
- analyzers for short period signals, or to generate videos;
#
: piano,#=
: chroma gram piano,@
: spiral,*%
: phase,*<
: source angle,*-*
: source location,|
: strings,&
: tonnetz;number
:@10
is to analyze10~s
spectral;''
: empty is to plot last analyzed analyzer graphics;two numbers
: generate video of analyzer at starting time & ending time;*
: play last calculated analyzer video result;
##
: to plot piano roll,##=
: chroma gram piano roll;two numbers
: plot piano roll at starting time & ending time;#10 20
will calculate the piano roll of10s
to20s
;''
: plot last calculated piano roll result;
^
: calculate the spectral tuning peaks frequencies (peaks) and plot;number
:^10
is to extract10~s
peaks frequencies components, music note names, and its frequency power at combined channel*
and separate channelnumber
;two numbers
:starting time
+tuning frequency (Hz)
, then plot tuning graphics,^0 99.041Hz
or^0 G2+18.31c
to plot tuning graphics at0~s
with tuning frequency99.041Hz
orG2+18.31c
;
>
: to play sine wave the given frequency;number+Hz
: to play sound directly from number of frequency;>440Hz
is to play sound at440Hz
;music notes name
: to play sound translate from music notes;>a4
is to playa4
notes;>a4-50c
is to play sound ata4
but with50
cents lower;number+m
: define sound source distance;number+rad
ornumber+deg
: define sound source angle;number+s
: define duration to play;
-
=
(WARNING: may cause fatal crash): toeval
in python (simple calculation) or toexec
in python (set system parameters);-
example:
=1+1
to get answer2
; -
example:
=self.n_window=512
to set then_window
to512
;
-
-
sh
: to executeshell
script;- example:
sh echo $PATH
to show$PATH
variable;
- example:
Path can be auto-complete and the space ' '
can be replaced by \s
.
Functions can be tested with ./demo/june.ogg
of piano song (Tchaikovsky - June Barcarolle Op. 37 No. 6; I played) with:
python see.py
More clear image can be achieved by setting smaller font size in terminal.
English|中文