Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
Typedefs | Functions
olaf_reader.h File Reference

Reads audio samples from a file in blocks of samples with a certain overlap. More...

#include "olaf_config.h"

Go to the source code of this file.

Typedefs

typedef struct Olaf_Reader Olaf_Reader
 

Functions

Olaf_Readerolaf_reader_new (Olaf_Config *config, const char *source)
 Create a new reader.
 
size_t olaf_reader_read (Olaf_Reader *olaf_reader, float *block)
 Read an audio block with overlap.
 
size_t olaf_reader_total_samples_read (Olaf_Reader *olaf_reader)
 Returns the number of samples read.
 
void olaf_reader_destroy (Olaf_Reader *olaf_reader)
 Free resources related to the reader.
 

Detailed Description

Reads audio samples from a file in blocks of samples with a certain overlap.

The configuration determines the block sizes and overlap between blocks.

Function Documentation

◆ olaf_reader_destroy()

void olaf_reader_destroy ( Olaf_Reader olaf_reader)

Free resources related to the reader.

Parameters
olaf_readerThe olaf reader state.

◆ olaf_reader_new()

Olaf_Reader * olaf_reader_new ( Olaf_Config config,
const char *  source 
)

Create a new reader.

Parameters
configThe configuration
[in]sourceThe path of the audio file. The audio file should be a raw mono file of a certain format.
Returns
A struct with internal state.

◆ olaf_reader_read()

size_t olaf_reader_read ( Olaf_Reader olaf_reader,
float *  block 
)

Read an audio block with overlap.

Parameters
olaf_readerThe olaf reader
blockAn array to store the audio samples.
Returns
The number of samples read.

◆ olaf_reader_total_samples_read()

size_t olaf_reader_total_samples_read ( Olaf_Reader olaf_reader)

Returns the number of samples read.

Parameters
olaf_readerThe olaf reader state.
Returns
The number of samples read in total.