x42 / silan Goto Github PK
View Code? Open in Web Editor NEWaudio file [silence] analyzer
License: GNU General Public License v2.0
audio file [silence] analyzer
License: GNU General Public License v2.0
silan -- Audiofile Silence Analyzer =================================== Silan is a standalone application to analyze audio files for silence and print ranges of detected signals. It supports a variety of audio-formats and codecs by making use of libsndfile and ffmpeg/libav for reading audio-data. Signal threshold and hold-off time can be freely configured. The output can be formatted with samples or seconds as unit or printed as audacity label file. For more information please read the included manual page. Silan is licensed in terms of the GNU General Public License (version 2 or later).
Step 1: Ensure your environment is Debian Squeeze
Step 2: Download any m4a file:
wget http://www.morrisontrio.com/resources/Morrison%20Trio%20Sample%20-%20Air%20by%20J.S.%20Bach.m4a
Step 3: analyze with -b
and -f json
parameters.
Output:
Segmentation fault
We have an mp3 that silan analyzes the duration to be 173311.111837 which is incorrect. When the file is uploaded via the Airtime interface mutagen tells us the file's length is 290.8212244897959
We have a ticket in Airtime Jira with more information. The mp3 is attached to that ticket:
http://dev.sourcefabric.org/browse/CC-5271
Hi,
silan 0.3.3 is not working on ubuntu 18.04.
silan --format=JSON 01-swank-cordovan_-_comprar_tiempo_\(vincent_kwok.mp3
*** stack smashing detected ***: terminated
Aborted (core dumped)
root@sugradio1127:/srv/airtime/stor/imported/1/Swank/Secret Weapons CDS# silan --version
silan version 0.3.3
Ubuntu 14.04. Configure bombs when checking for libsndfile, which I built from source. What am I missing? What should I check for? Etc. I was successful with these steps on a different Ubuntu 14.04 server. Output from configure:
./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for size_t... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking if -Wl,--as-needed works... yes
./configure: line 11990: syntax error near unexpected token SNDFILE,' ./configure: line 11990:
PKG_CHECK_MODULES(SNDFILE, sndfile)'
As i mentioned in #3 (comment) Debian testing is currently exhibiting segfaults.
This can be reproduced using the following steps on a new nightly netinst iso install:
apt-get update
apt-get install silan
curl -o /tmp/incorrect.mp3 https://dev.sourcefabric.org/secure/attachment/23028/incorrect.mp3
silan -b -f JSON /tmp/incorrect.mp3
Segmentation fault (core dumped)
I'm using the file from #3 since it came in handy. All the files i checked so far are segfaulting.
I have put the output of trace silan -b -f JSON /tmp/incorrect.mp3
in strace.txt and you can find the backtrace from gdb /usr/bin/silan core -ex bt
in gdb.bt.txt.
Let me know if you need any more information.
I am on Arch Linux and try to build the package from AUR:
https://aur.archlinux.org/packages/silan-git
quite early in the building process, I get errors in ad_ffmpeg.c: In function ‘ad_open_ffmpeg’ as shown below:
-----8<-----
make all-recursive
make[1]: Entering directory '/data/share/aur/silan-git/src/silan'
Making all in audio_decoder
make[2]: Entering directory '/data/share/aur/silan-git/src/silan/audio_decoder'
gcc -DHAVE_CONFIG_H -I. -I.. -g -Wall -O2 -I.. -I/usr/include/opus -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -DNDEBUG -pipe -fmessage-length=139 -fdiagnostics-show-location=every-line -MT ad_ffmpeg.o -MD -MP -MF .deps/ad_ffmpeg.Tpo -c -o ad_ffmpeg.o ad_ffmpeg.c
gcc -DHAVE_CONFIG_H -I. -I.. -g -Wall -O2 -I.. -I/usr/include/opus -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -DNDEBUG -pipe -fmessage-length=139 -fdiagnostics-show-location=every-line -MT ad_plugin.o -MD -MP -MF .deps/ad_plugin.Tpo -c -o ad_plugin.o ad_plugin.c
gcc -DHAVE_CONFIG_H -I. -I.. -g -Wall -O2 -I.. -I/usr/include/opus -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -DNDEBUG -pipe -fmessage-length=139 -fdiagnostics-show-location=every-line -MT ad_soundfile.o -MD -MP -MF .deps/ad_soundfile.Tpo -c -o ad_soundfile.o ad_soundfile.c
ad_ffmpeg.c: In function ‘ad_open_ffmpeg’:
ad_ffmpeg.c:117:40: error: ‘AVStream’ has no member named ‘codec’
117 | if (priv->formatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
| ^~
ad_ffmpeg.c:128:71: error: ‘AVStream’ has no member named ‘codec’
128 | priv->codecContext = priv->formatContext->streams[priv->audioStream]->codec;
| ^~
-----8<-----
Any way to fix this?
Regards,
Clemens
Hi,
Not too experienced with audio but I like the idea of silan. Howver i get this error and can't figure it out. Any ideas?
# sudo silan -vvvvvvvv -f JSON '/music/123.mp3' [NULL @ 0xaae2a0] Value 4707126720094797824.000000 for parameter 'probesize' out of range [NULL @ 0xaae2a0] Value 4707126720094797824.000000 for parameter 'analyzeduration' out of range [NULL @ 0xaae2a0] Value 4697254411347427328.000000 for parameter 'indexmem' out of range [NULL @ 0xaae2a0] Value 4703785510416416768.000000 for parameter 'rtbufsize' out of range [NULL @ 0xaae2a0] Value -4616189618054758400.000000 for parameter 'fpsprobesize' out of range [NULL @ 0xaae2a0] Value 4607182418800017408.000000 for parameter 'f_err_detect' out of range [NULL @ 0xaae2a0] Value 4607182418800017408.000000 for parameter 'err_detect' out of range [mp3 @ 0xaae2a0] Format mp3 detected only with low score of 25, misdetection possible! [NULL @ 0xaae8a0] Value 4686111960511545344.000000 for parameter 'b' out of range [NULL @ 0xaae8a0] Value 4683532506232782848.000000 for parameter 'ab' out of range [NULL @ 0xaae8a0] Value 4705844345939427328.000000 for parameter 'bt' out of range [NULL @ 0xaae8a0] Value 4617315517961601024.000000 for parameter 'me_method' out of range [NULL @ 0xaae8a0] Value 4622945017495814144.000000 for parameter 'g' out of range [NULL @ 0xaae8a0] Value 4611686018427387904.000000 for parameter 'qmin' out of range [NULL @ 0xaae8a0] Value 4629418941960159232.000000 for parameter 'qmax' out of range [NULL @ 0xaae8a0] Value 4613937818241073152.000000 for parameter 'qdiff' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'wpredp' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'bug' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'er' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'err_detect' out of range [NULL @ 0xaae8a0] Value 4613937818241073152.000000 for parameter 'ec' out of range [NULL @ 0xaae8a0] Value 4620693217682128896.000000 for parameter 'ildctcmp' out of range [NULL @ 0xaae8a0] Value 4620693217682128896.000000 for parameter 'subq' out of range [NULL @ 0xaae8a0] Value 4696837138094751744.000000 for parameter 'ibias' out of range [NULL @ 0xaae8a0] Value 4696837138094751744.000000 for parameter 'pbias' out of range [NULL @ 0xaae8a0] Value 4642507528377204736.000000 for parameter 'lmin' out of range [NULL @ 0xaae8a0] Value 4660262442142531584.000000 for parameter 'lmax' out of range [NULL @ 0xaae8a0] Value 4696130710463840256.000000 for parameter 'flags2' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'threads' out of range [NULL @ 0xaae8a0] Value 4620693217682128896.000000 for parameter 'nssew' out of range [NULL @ 0xaae8a0] Value -4586705114244317184.000000 for parameter 'profile' out of range [NULL @ 0xaae8a0] Value -4586705114244317184.000000 for parameter 'level' out of range [NULL @ 0xaae8a0] Value 4623507967449235456.000000 for parameter 'skipcmp' out of range [NULL @ 0xaae8a0] Value 4642507528377204736.000000 for parameter 'mblmin' out of range [NULL @ 0xaae8a0] Value 4660262442142531584.000000 for parameter 'mblmax' out of range [NULL @ 0xaae8a0] Value 4643211215818981376.000000 for parameter 'mepc' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'bidir_refine' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'cqp' out of range [NULL @ 0xaae8a0] Value 4627730092099895296.000000 for parameter 'keyint_min' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'refs' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'directpred' out of range [NULL @ 0xaae8a0] Value 4618441417868443648.000000 for parameter 'sc_factor' out of range [NULL @ 0xaae8a0] Value 4643211215818981376.000000 for parameter 'mv0_threshold' out of range [NULL @ 0xaae8a0] Value 4630826316843712512.000000 for parameter 'b_sensitivity' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'compression_level' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'min_prediction_order' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'max_prediction_order' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'prediction_order_method' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'min_partition_order' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'max_partition_order' out of range [NULL @ 0xaae8a0] Value 4607182418800017408.000000 for parameter 'ticks_per_frame' out of range [NULL @ 0xaae8a0] Value 4611686018427387904.000000 for parameter 'color_primaries' out of range [NULL @ 0xaae8a0] Value 4611686018427387904.000000 for parameter 'color_trc' out of range [NULL @ 0xaae8a0] Value 4611686018427387904.000000 for parameter 'colorspace' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'aq_mode' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'rc_lookahead' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'lpc_type' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'lpc_passes' out of range [NULL @ 0xaae8a0] Value 4613937818241073152.000000 for parameter 'thread_type' out of range [NULL @ 0xaae8a0] Value -4616189618054758400.000000 for parameter 'request_sample_fmt' out of range [mp3 @ 0xaae2a0] decoding for stream 0 failed [mp3 @ 0xaae2a0] Could not find codec parameters (Audio: mp3, 0 channels, s16) [mp3 @ 0xaae2a0] Estimating duration from bitrate, this may be inaccurate ad_open_ffmpeg(): av_find_stream_info failed ! cannot open audio file '/music/123.mp3'
I'm sure this an error on my part, just cant find it.
Adam
When testing our audio chain with different file formats I found that silan does return the different results, depending on the file format. I was expecting small disparities, but the result when analyzing an MP3 file was off by more than half a second.
The test audio starts with 200ms silence, followed by 600ms noise, followed by 1200ms silence. I used FLAC, ogg vorbis and MP3 as file formats. This was the output by silan:
$ silan padded.mp3
0.367868 Sound On
1.677347 Sound Off
$ silan padded.ogg
0.197891 Sound On
0.825397 Sound Off
$ silan padded.flac
0.200023 Sound On
0.825374 Sound Off
As you can see, the ogg vorbis and FLAC files are okay, but the MP3 is off.
I checked the individual files with a spectrum analyzer, and they seem to be okay.
Here is a zip with the three audio files: padded-audio.zip
I tried out different different silan options, but no luck so far.
The following versions were used:
$ silan --version
silan version 0.4.0
$ pkg-config --modversion sndfile
1.0.28
$ ffmpeg -version
ffmpeg version 4.0.3 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Silan attempts to re-analyze files that fail during the process and loops indefinitely.
All the details are here:
http://dev.sourcefabric.org/browse/CC-5270
Hi,
I´m using silan to connect to a stream which is always available but not always broadcasting (worship service).
Sometimes there is some noise on the stream so i use '-t holdoff' to get notitied when the stream is up for a few minutes. Does this -t holdoff also work for the silence detection?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.