jorensix / olaf Goto Github PK
View Code? Open in Web Editor NEWOlaf: Overly Lightweight Acoustic Fingerprinting is a portable acoustic fingerprinting system.
License: GNU Affero General Public License v3.0
Olaf: Overly Lightweight Acoustic Fingerprinting is a portable acoustic fingerprinting system.
License: GNU Affero General Public License v3.0
Hi,
I'm trying to compile the web version but 'wasm/js/olaf_processor_edit.js' is missing.
And I'm getting this error in Chrome:
DOMException: Failed to construct 'AudioWorkletNode': AudioWorkletNode cannot be created: The node name 'olaf-processor' is not defined in AudioWorkletGlobalScope.
Can you please upload this file also to the repository ?
Thank you!
Hi there! I am working on a proof of concept, and I have managed to correctly install Olaf and fingerprint a track. However, when I run the web build I can't get a successful response. I am running make web
after adding the track and then running the server - are there any steps I am missing?
Additional: After testing olaf monitor test.mp3
it threw the following error:
query index,total queries, query name, match name, match id, match count (#), q to ref time delta (s), ref start (s), ref stop (s), query time (s) Traceback (most recent call last): 8: from /usr/local/bin/olaf:372:in `<main>' 7: from /usr/local/bin/olaf:372:in `each_with_index' 6: from /usr/local/bin/olaf:372:in `each' 5: from /usr/local/bin/olaf:373:in `block in <main>' 4: from /usr/local/bin/olaf:80:in `monitor' 3: from /usr/local/bin/olaf:180:in `with_converted_audio_part' 2: from /usr/local/bin/olaf:84:in `block in monitor' 1: from /usr/local/bin/olaf:84:in `each' /usr/local/bin/olaf:91:in `block (2 levels) in monitor': undefined local variable or method `filename' for main:Object (NameError)
Could this be related to the issue I am having in failing to recognise tracks or is this another issue?
I rewrite the ruby layer to request only the C code, I use the default (stock) config to store cached acoustic fingerprint to a custom directory with a php CLI only script (only exec() line can interest you) :
(TMP operation on tmpfs RAM)
foreach($audiocodecs as $i => $audiocodec) {
$acoustic = "$ACOUSTICDIR/$videobase.$filesize.$i.csv.gz";
if(file_exists($acoustic))
continue;
echo "$videofile\n";
exec("ffmpeg -loglevel quiet -i \"$videofile\" -map 0:a:$i -ac 1 -ar 16000 -f f32le -acodec pcm_f32le \"$TMPRAW\"");
echo "$acoustic\n";
exec("Olaf/bin/olaf_c print \"$TMPRAW\" \"$videofile\" | gzip > \"$TMPGZ\" && mv \"$TMPGZ\" \"$acoustic\"", $output);
unlink($TMPRAW);
}
And to build the B+ tree I use a loop to load all ~1h40/2h (average movie duration) audio tracks :
foreach($audiocodecs as $i => $audiocodec) {
$acoustic = "$ACOUSTICDIR/$videobase.$filesize.$i.csv.gz";
if(!file_exists($acoustic))
continue;
echo "$videofile\n";
exec("gunzip -c \"$acoustic\"", $output);
$content = "";
foreach($output as $line)
$content .= "1/1,$videobase.$i,$line\n";
file_put_contents($TMPCSV, $content);
echo "$acoustic\n";
exec("Olaf/bin/olaf_c store_cached \"$TMPCSV\"");
}
I can generate all my audio track fingerprint from movies, all gz are lightweight, but integration into B+ tree part is too slow and db become too huge. even on my i9 64GB DDR5 / PCIE SSD machine :(
How you can store 340 days of audio (around 800GB of mp3s) inside a 15GB database ? mine grow way faster than this with your default config https://github.com/JorenSix/Olaf/blob/master/src/olaf_config.c .... and I have about 4000 days (10 years !) of sound to index !!!!! game over lol But with an estimation based on your result, this must enter inside 150GB database, good for me, but this is not the case (I grow rapidly over multiples terabytes and show as a snail to rebuild the B+ tree from all lightweight fingerprints.csv.gz)
Related to openjournals/joss-reviews#5459
Line 201 in 0a77207
Could it also be worth mention the olaf clear
command in this section?
Related to openjournals/joss-reviews#5459
I think it's normal, but when running the unit tests on Linux (Ubuntu 22.04 LTS) and macOS (Catalina):
git clone https://github.com/JorenSix/Olaf
cd Olaf
make && make install
ruby eval/olaf_functional_tests.rb
I get the following "error" at the very beginning:
Database Error: No such file or directory
But I guess this is normal as there is a "PASS" just after to make sure the Database is empty?
Otherwise all tests pass 👍
Line 261 in 0a77207
Hi, @JorenSix .
I tryed to compare JAVA and C FP algorithmus ans found out aparts of code in C version:
uint64_t m1LargerThanm2 = m1 > m2 ? 1 : 0;
uint64_t m2LargerThanm3 = m2 > m3 ? 1 : 0;
uint64_t m3LargerThanm1 = m3 > m1 ? 1 : 0;
m1LargerThanm2 = 0;
m2LargerThanm3 = 0;
m3LargerThanm1 = 0;
So in C version mXLargerThenmY
is zeroed, but in JAVA it's not. Why? A BUG or a feature?
I saw that Fragmented by default use 5 seconds, I'll like to know if OLAF can detect different version of audio, with just 2 or 3 seconds of different between them?
We have some ads that are 20 second long, but inside only 3 seconds or less change, that is common case into retails that has different products ads where they use the same sound and speech just changing Product Brand or name.
Some way to tune, fragmented to can improve the version detection?
thanks!
Hi!
As I can see, thre is only one thing ffmpeg
do - converting audio data to 32float 16KHz mono stream.
Why this format of audio data was choosen?
Hello Joren!
First of all, I want to thank you for publishing this project on Github!
Have the problem that an audio snippet is not recognized.
olaf store store.mp3
olaf query external-stream.mp3
Side note, in my case the monitor command throws an error, maybe this is related.
olaf monitor external-stream.mp3
$ olaf monitor external-stream.mp3
1/1_0s external-stream.mp3 matches trimmed.mov q_to_ref_time_delta: 0.00, q_time: 5.44, score: 146, match_id: 779030374, ref_start: 0.29, ref_stop: 5.44
1/1_0s external-stream.mp3 Proccessed 471 fp's from 7.0s in 0.004s (1962 times realtime)
1/1_0s external-stream.mp3 Audio file 151390292 not found or unreadable.
1/1_7s external-stream.mp3 Proccessed 502 fp's from 7.0s in 0.004s (1969 times realtime)
1/1_7s external-stream.mp3 Audio file 151390292 not found or unreadable.
1/1_14s external-stream.mp3 Proccessed 515 fp's from 7.0s in 0.003s (2020 times realtime)
1/1_14s external-stream.mp3 Audio file 151390292 not found or unreadable.
Traceback (most recent call last):
9: from /usr/local/bin/olaf:460:in `<main>'
8: from /usr/local/bin/olaf:460:in `each_with_index'
7: from /usr/local/bin/olaf:460:in `each'
6: from /usr/local/bin/olaf:461:in `block in <main>'
5: from /usr/local/bin/olaf:84:in `monitor'
4: from /usr/local/bin/olaf:189:in `with_converted_audio_part'
3: from /usr/local/bin/olaf:88:in `block in monitor'
2: from /usr/local/bin/olaf:88:in `each'
1: from /usr/local/bin/olaf:95:in `block (2 levels) in monitor'
/usr/local/bin/olaf:95:in `basename': no implicit conversion of nil into String (TypeError)
Maybe you can help me with that.
Greetings Fred
Archive.zip
Im currently trying to run the ESP32 example.
Unfortunately im struggling to understand the Output. It does look like its not working properly but I dont know what the Problem is.
Here is the Output from the Arduino IDE:
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13924
ho 0 tail 12 room 4
load:0x40080400,len:3600
entry 0x400805f0
[OLAF] Free memory before init: 273124 bytes
No home directory found, will use './db' as db folderMem DB for '852601.wav', 193.761s duration, 13207 fingerprints, 666 identifier
[OLAF] Free after init: 150444 bytes
[OLAF] Initialized with 32091 audio samples. Sample sample: 0.036510
Event point index: 0
[OLAF] processed audio block index: 0
Event point index: 0
[OLAF] processed audio block index: 1
Event point index: 0
[OLAF] processed audio block index: 2
Event point index: 0
[OLAF] processed audio block index: 3
Event point index: 0
[OLAF] processed audio block index: 4
Event point index: 0
[OLAF] processed audio block index: 5
Event point index: 0
[OLAF] processed audio block index: 6
Event point index: 0
[OLAF] processed audio block index: 7
Event point index: 0
[OLAF] processed audio block index: 8
Event point index: 0
[OLAF] processed audio block index: 9
Event point index: 0
[OLAF] processed audio block index: 10
Event point index: 0
[OLAF] processed audio block index: 11
Event point index: 0
[OLAF] processed audio block index: 12
Event point index: 0
...
...
[OLAF] processed audio block index: 106
Event point index: 29
[OLAF] processed audio block index: 107
Event point index: 30
[OLAF] processed audio block index: 108
Event point index: 30
[OLAF] processed audio block index: 109
Event point index: 31
FP index: 6
0, 0.00, 0.00, , 0, 0.00, 0.00
[OLAF] processed audio block index: 110
Event point index: 23
[OLAF] processed audio block index: 111
Hi, @JorenSix
There is no boundaries control for fp_extractor->fingerprints.fingerprints
.
So, [fp_extractor->fingerprints.fingerprintIndex
can be incremented and go out of initial allocated for fp_extractor->fingerprints.fingerprints
memmory block. I causes memory corruption in other modules and unpredictable behaivior.
I fixed this with additional condition in for
loops:
for(int k = j+1; k < eventPoints->eventPointIndex && fp_extractor->fingerprints.fingerprintIndex < fp_extractor->config->maxFingerprints; k++){
and
for(int j = i+1; j < eventPoints->eventPointIndex && fp_extractor->fingerprints.fingerprintIndex < fp_extractor->config->maxFingerprints; j++){
But I do not know how would this affect fingerprinting algotithmus.
Hi,
The olaf_fp_ref_mem.h included in the zip file from here:
https://0110.be/files/attachments/475/ESP32-Olaf.zip
Has a number of nuls on line 7.
In addition to that the content is different from the same file in the arduino sketch folder for esp32_inmp441_olaf
Should the nuls be there?
What song does this file represent?
2nd set of questions -
When trying to compile the arduino sketch esp32_inmp441_olaf.ino
I found I had to copy the content of the files referenced in the esp32_inmp441_olaf folder. Despite that I have been unable to successfully link the code.
Are you able to provide guidance as to how to build your original hardware and ESP32 code that you used here:
https://0110.be/posts/Olaf_-_Acoustic_fingerprinting_on_the_ESP32_and_in_the_Browser
For example what ESP32 board did you use and what pins did you have the microphone connected to?
I believe that this is a very interesting project and would like to replicate it.
Sean
Related to: openjournals/joss-reviews#5459
Could you run a spell-checker on this page? There a few typos. For example:
Line 3 in 0173ff1
Line 51 in 0173ff1
Line 84 in 0173ff1
Hi, @JorenSix
Is there a difference between C and JAVA algorithmus implemetation?
In fingerprints?
In DB sructure?
In configuration parameters?
Related to openjournals/joss-reviews#5459
Line 64 in 0a77207
You do it later on for the tests, but perhaps you could also give the full installation steps even if it's "obvious":
sudo apt-get install ffmpeg ruby
git clone https://github.com/JorenSix/Olaf
cd Olaf
make && make install
On a similar note, is it possible to make Olaf
"apt-get install"-able? And such that dependencies are also installed. That would be nice for convenience.
beeping.zip
I'm having a hard time recognizing my audio signal consistently. It is a short sequence of well defined tones (audio file in attachment).
Is the method in this library suited for this type of audio? if so, could you recommend olaf_config.c
configuration to fingerprint and recognize this signal using ESP32? Furthermore, is it possible to recognize and distinguish between multiple such audio signals (different tone patterns) on the ESP?
thanks in advance
malloc
in https://github.com/JorenSix/Olaf/blob/master/src/olaf_config.c#L30 is off-by-one (for NUL byte).
Hi, @JorenSix
Why is this project written in C and not in C++?
In source code I see some imitation of C++ classes, like in "Perl".
From doc say:
On traditional computers fingerprints are stored in a high-performance key-value-store: LMDB. LMDB offers an a B+-tree based persistent storage ideal for small keys and values with low storage overhead.
Is possible hosting the DB into remote server and connect Olaf to them?
I saw into LMDB doc the warning:
Do not use LMDB databases on remote filesystems, even between processes on the same host. This breaks flock() on some OSes, possibly memory map sync, and certainly sync between programs on different hosts.
src/olaf_ep_extractor.c:152
void rotate(Olaf_EP_Extractor * ep_extractor){
ep_extractor->maxes[i-1]=ep_extractor->maxes[i];
ep_extractor->mags[i-1]=ep_extractor->mags[i];
Is there a pointer
to array row assignment or you meaned array row values
assigment?
Related to: openjournals/joss-reviews#5459
Line 38 in 0173ff1
Hi, @JorenSix .
I tried to add multithreading and find out, that there is a problem with multithreading:
Could you explain, is it 'by design' or is it a BUG also?
Can Olaf be compiled and run on windows OS? If yes kindle post compile instructions
Hi, do you also have an example how to run this on an esp32?
Hi,
I have just installed Olaf in Debian Buster and I can't get it to work.
Whenever I try to add a reference track, either with
olaf store filename.mp3
or
olaf_c store filename.mp3
I get a Segmentation fault (core dumped).
Do you reckon what could be going on?
Thank you.
I think it would be helpful if users/contributors had instructions for running the automated tests locally when possible. The README makes reference to the scripts in the eval/
directory, but it's not clear how to use them, when contributors should execute certain tests, and so on.
Similarly, there appears to be a test
target in the Makefile that claims to "build and test" olaf, but no test is actually executed. If this is intended to be part of the testing suite, it'd be a good idea to include that in the README as well.
Related to: openjournals/joss-reviews#5459
Trying to run the example to generate header.h file, but i cannot compile olaf_mem
make mem
in WSL returns:
make mem
gcc -c src/pffft.c -Dmem -W -Wall -std=gnu11 -pedantic -O2 #pfft needs M_PI and other constants not in the ANSI c standard
gcc -c src/hash-table.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/queue.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_deque.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_max_filter_perceptual_van_herk.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf.c -Dmem -W -Wall -std=gnu11 -pedantic -O2
gcc -c src/olaf_db_mem.c -Dmem -W -Wall -std=c11 -pedantic -O2
src/olaf_db_mem.c: In function ‘olaf_db_find’:
src/olaf_db_mem.c:112:42: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
112 | for(size_t i = index ; i >= 0 ;i--){
| ^~
gcc -c src/olaf_fp_db_writer_mem.c -Dmem -W -Wall -std=c11 -pedantic -O2
src/olaf_fp_db_writer_mem.c: In function ‘olaf_fp_db_writer_destroy’:
src/olaf_fp_db_writer_mem.c:93:36: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
93 | printf("%llu,\n",db_writer->hashes[i]);
| ~~~^ ~~~~~~~~~~~~~~~~~~~~
| | |
| long long unsigned int uint64_t {aka long unsigned int}
| %lu
gcc -c src/olaf_fp_file_writer.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_fp_db_writer_cache.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_runner.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_stream_processor.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_ep_extractor.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_fp_extractor.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_reader_stream.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_fp_matcher.c -Dmem -W -Wall -std=c11 -pedantic -O2
gcc -c src/olaf_config.c -Dmem -W -Wall -std=c11 -pedantic -O2
mkdir -p bin
gcc -o bin/olaf_mem *.o -lc -lm -ffast-math
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_new':
olaf_db_mem.c:(.text+0x0): multiple definition of `olaf_db_new'; olaf_db.o:olaf_db.c:(.text+0x50): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_store':
olaf_db_mem.c:(.text+0x70): multiple definition of `olaf_db_store'; olaf_db.o:olaf_db.c:(.text+0x7f0): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_find':
olaf_db_mem.c:(.text+0xc0): multiple definition of `olaf_db_find'; olaf_db.o:olaf_db.c:(.text+0x8e0): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_find_single':
olaf_db_mem.c:(.text+0x2b0): multiple definition of `olaf_db_find_single'; olaf_db.o:olaf_db.c:(.text+0xa50): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_destroy':
olaf_db_mem.c:(.text+0x2f0): multiple definition of `olaf_db_destroy'; olaf_db.o:olaf_db.c:(.text+0xe00): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_stats':
olaf_db_mem.c:(.text+0x300): multiple definition of `olaf_db_stats'; olaf_db.o:olaf_db.c:(.text+0xcc0): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_string_hash':
olaf_db_mem.c:(.text+0x320): multiple definition of `olaf_db_string_hash'; olaf_db.o:olaf_db.c:(.text+0x1b0): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_store_meta_data':
olaf_db_mem.c:(.text+0x330): multiple definition of `olaf_db_store_meta_data'; olaf_db.o:olaf_db.c:(.text+0x2f0): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_find_meta_data':
olaf_db_mem.c:(.text+0x400): multiple definition of `olaf_db_find_meta_data'; olaf_db.o:olaf_db.c:(.text+0x430): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_delete_meta_data':
olaf_db_mem.c:(.text+0x430): multiple definition of `olaf_db_delete_meta_data'; olaf_db.o:olaf_db.c:(.text+0x3b0): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_has_meta_data':
olaf_db_mem.c:(.text+0x440): multiple definition of `olaf_db_has_meta_data'; olaf_db.o:olaf_db.c:(.text+0x780): first defined here
/usr/bin/ld: olaf_db_mem.o: in function `olaf_db_stats_meta_data':
olaf_db_mem.c:(.text+0x450): multiple definition of `olaf_db_stats_meta_data'; olaf_db.o:olaf_db.c:(.text+0x520): first defined here
/usr/bin/ld: olaf_fp_db_writer_mem.o: in function `olaf_fp_db_writer_new':
olaf_fp_db_writer_mem.c:(.text+0x20): multiple definition of `olaf_fp_db_writer_new'; olaf_fp_db_writer.o:olaf_fp_db_writer.c:(.text+0x0): first defined here
/usr/bin/ld: olaf_fp_db_writer_mem.o: in function `olaf_fp_db_writer_store':
olaf_fp_db_writer_mem.c:(.text+0x60): multiple definition of `olaf_fp_db_writer_store'; olaf_fp_db_writer.o:olaf_fp_db_writer.c:(.text+0x40): first defined here
/usr/bin/ld: olaf_fp_db_writer_mem.o: in function `olaf_fp_db_writer_delete':
olaf_fp_db_writer_mem.c:(.text+0x140): multiple definition of `olaf_fp_db_writer_delete'; olaf_fp_db_writer.o:olaf_fp_db_writer.c:(.text+0x140): first defined here
/usr/bin/ld: olaf_fp_db_writer_mem.o: in function `olaf_fp_db_writer_destroy':
olaf_fp_db_writer_mem.c:(.text+0x150): multiple definition of `olaf_fp_db_writer_destroy'; olaf_fp_db_writer.o:olaf_fp_db_writer.c:(.text+0x240): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:95: mem] Error 1```
I'm on an M1 Mac running Ventura. gcc
is symlinked to clang
on my system, which isn't unusual on macOS.
When I build the test binary using make test
, and then run bin/olaf_tests
, an assertion fails:
(array_size == 512), function olaf_max_filter, file olaf_max_filter_perceptual.c, line 43.
Further, when I run eval/olaf_functional_tests.rb
I get the following output:
PASS: Test dataset check: If not found, download it first! call e.g. 'ruby eval/olaf_download_dataset.rb'
1/1 1051039.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/1051039.mp3'
1/1 1071559.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/1071559.mp3'
1/1 1075784.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/1075784.mp3'
1/1 11266.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/11266.mp3'
1/1 147199.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/147199.mp3'
1/1 173050.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/173050.mp3'
1/1 189211.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/189211.mp3'
1/1 297888.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/297888.mp3'
1/1 612409.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/612409.mp3'
1/1 852601.mp3 SKIP: already stored audio
PASS: Command : olaf store 'dataset/ref/852601.mp3'
FAIL: Expected 10 stored, was 11
FAIL: Expected 10 stored, was 11
Related to: openjournals/joss-reviews#5459
Line 91 in 0b08dd9
monitor
command (maybe it should be an audio_filename
instead of filename
)
/tmp/Olaf # olaf monitor input.mp3
/usr/local/bin/olaf:91:in `block (2 levels) in monitor': undefined local variable or method `filename' for main:Object (NameError)
from /usr/local/bin/olaf:84:in `each'
from /usr/local/bin/olaf:84:in `block in monitor'
from /usr/local/bin/olaf:180:in `with_converted_audio_part'
from /usr/local/bin/olaf:80:in `monitor'
from /usr/local/bin/olaf:373:in `block in <main>'
from /usr/local/bin/olaf:372:in `each'
from /usr/local/bin/olaf:372:in `each_with_index'
from /usr/local/bin/olaf:372:in `<main>'
For a freshly added file, I cannot delete it from the database.
$ olaf delete "test.mp3"
Traceback (most recent call last):
6: from /usr/local/bin/olaf:340:in `<main>'
5: from /usr/local/bin/olaf:340:in `each_with_index'
4: from /usr/local/bin/olaf:340:in `each'
3: from /usr/local/bin/olaf:341:in `block in <main>'
2: from /usr/local/bin/olaf:299:in `delete'
1: from /usr/local/bin/olaf:138:in `with_converted_audio'
/usr/local/bin/olaf:300:in `block in delete': undefined local variable or method `audio_identifer' for main:Object (NameError)
Did you mean? audio_filename
ERROR: 1
Unfortunately, I do not speak ruby, but I also don't see any sign of the undefined variable, so I daresay the error is correct.
Hi,
I am developing an application which communicates with external device and it should be able to perform diagnostics on this device according to sound made by it. I found your project today and I thought it fits ideally in my needs, however I have some serious problems with running it.
I am using ESP32 as my platform with I2S microphone (it is already working), so I wanted to build OLAF Mem version. It succeeded, but calling ./olaf_mem store sample.mp3 wav 666
generates following output:
Stored 0 fp's from 16.8s in 0.108s (156 times realtime)
I think that Ruby script is responsible for generating fingerprints, however I don't know how to use it correctly. Of course both ruby
and ffmpeg
are in my PATH.
Are you able to help me with generating fingerprints?
Hi,
I'm interested in finding near-duplicate audio files. My dataset is about 3000 thousands short audio files, between 0.5 seconds to 5 seconds. Unlike Shazam, both the "target" audio (i.e. the songs in Shazam's case) and the user input are short, and both might contain noise.
Can this library help?
If so, are there any recommendations for tuning parameters?
N.B - if a file is matched to multiple other files, it's fine - I have a less efficient algorithm that can verify which match is correct. In other words, I can handle some amount of false positives, but I don't want false negatives.
For testing I have "stored" an mp3 (compilation.mp3) made from several tracks against which I have run 3 queries.
Query 1 = .mp3 of one of the tracks (made from the original .flac used to make the compilation) so would expect a single match but got the following:
1/3 TestAll54sec.mp3 match id, match count (#), q to ref time delta (s), ref start (s), ref stop (s), query time (s)
1, 3, TestAll54sec.mp3, 2146557281, /home/apb/Olaf-master/Compilation.mp3, 55, -2594.35, 2637.10, 2648.18, 53.83
1, 3, TestAll54sec.mp3, 2146557281, /home/apb/Olaf-master/Compilation.mp3, 6, -2594.34, 2643.14, 2643.14, 48.80
Query 2 = a 15sec clip from the same track as query 1
2, 3, Test15sec.mp3, 2146557281, /home/apb/Olaf-master/Compilation.mp3, 332, -2608.95, 2609.14, 2623.73, 14.78
Query 3 = the original .flac file used to make the .mp3 for query 1
3, 3, TestAll54secFLAC.flac, 2146557281, /home/apb/Olaf-master/Compilation.mp3, 84, -2594.35, 2637.10, 2648.03, 53.68
Questions:
Hello,
Storing raw need a lot of space and deleting is bad for B+ tree.
There is no way to store only individual fingerprints to add/remove and rebuild a clean B+ tree for search ?
Related to: openjournals/joss-reviews#5459
Line 40 in 0173ff1
OS: Debian 10 x64
gcc version 8.3.0 (Debian 8.3.0-6)
For some reason olaf_c
goes to segmentation fault
on some files.
It is simply reprodusable on store
and on query
mode.
query
mode make output as:
...
start key: 4365488144 stop key: 4365488154 results 0
start key: 4365488144 stop key: 4365488154 results 0
Segmentation fault
GDB
does not show paticular line, but shows :
Program received signal SIGSEGV, Segmentation fault.
0x0000555555565003 in olaf_reader_read ()
(gdb) backtrace
#0 0x0000555555565003 in olaf_reader_read ()
#1 0x000055555556542d in olaf_stream_processor_process ()
#2 0x000055555555674e in main ()
(gdb)
Was just trying to compile this and ran into an error when I run make web
$ make web
emcc -o wasm/js/olaf.html -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS="['_malloc','_free']" -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' src/olaf_wasm.c src/pffft.c src/olaf_ep_extractor.c src/olaf_fp_extractor.c src/olaf_fp_db_mem.c src/olaf_fp_db_writer_mem.c src/olaf_fp_matcher_fast.c src/olaf_config.c -O3 -Wall -lm -lc -W -I.
src/olaf_wasm.c:125:8: error: initializing 'int' with an expression of incompatible type 'void'
int maxMatchScore = olaf_fp_matcher_match(state.fp_matcher,state.fingerprints);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
emcc: error: '/Users/chris/code/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=17 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/Users/chris/code/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -O3 -Wall -W -I. src/olaf_wasm.c -c -o /var/folders/gb/dws9z6hs4f12k5m58zl7s1c40000gn/T/emscripten_temp_6q5sozgt/olaf_wasm_0.o' failed (1)
make: *** [web] Error 1
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I'm not too familiar with C these days. Any ideas?
Related to openjournals/joss-reviews#5459
Line 39 in 0a77207
Perhaps you can write out the three reasons as a list so that it stands out?
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.