#include <AudioDataset.h>
|
| std::string | m_version = "1.0" |
| |
| std::map< std::string, std::vector< std::pair< std::string, std::vector< float > > > > | m_dataset |
| |
| std::array< std::string, 753 > | CatIDSet |
| |
◆ AudioDataset()
| krotos::AudioDataset::AudioDataset |
( |
| ) |
|
◆ ~AudioDataset()
| krotos::AudioDataset::~AudioDataset |
( |
| ) |
|
◆ assetsChanged()
| bool krotos::AudioDataset::assetsChanged |
( |
| ) |
|
|
private |
Checks whether the factory assets have changed from those cached.
- Returns
- true or false
◆ cacheExists()
| bool krotos::AudioDataset::cacheExists |
( |
| ) |
|
|
private |
Checks if the analysis has been previously cached to a json file.
- Returns
- whether the cache exists
◆ deleteCache()
| bool krotos::AudioDataset::deleteCache |
( |
| ) |
|
|
private |
Attempts to delete an existing cached json file.
- Returns
- whether the delete was successful
◆ extractCatID()
| std::string krotos::AudioDataset::extractCatID |
( |
std::string | filename | ) |
const |
|
private |
Extracts UCS CatID key from a filename.
- Parameters
-
| filename | the filename that potentially contains UCS data |
- Returns
- the extracted key
◆ findValidFiles()
| std::vector< File > krotos::AudioDataset::findValidFiles |
( |
| ) |
const |
|
private |
Searches for valid files (valid CatID and 48 kHz samplerate).
- Returns
- search results as a vector of filepaths
◆ fixKeyErrors()
| std::string krotos::AudioDataset::fixKeyErrors |
( |
std::string | key | ) |
const |
|
private |
Corrects some CatID key errors due to mislabelled factory assets.
- Parameters
-
- Returns
- key with potential modifications
◆ getDatasetFile()
| File krotos::AudioDataset::getDatasetFile |
( |
| ) |
const |
|
private |
Cross-platform location to cache analysis.
- Returns
- the full path
◆ getFactoryAssetDirectory()
| File krotos::AudioDataset::getFactoryAssetDirectory |
( |
| ) |
const |
|
private |
Cross-platform location of factory assets to analyse (wav files).
- Returns
- the full path
◆ getPathsSet()
| std::set< std::string > krotos::AudioDataset::getPathsSet |
( |
| ) |
const |
|
private |
Computes the set of filepaths used in the current analysis.
- Returns
- the set of filepath strings
◆ readCache()
| bool krotos::AudioDataset::readCache |
( |
| ) |
|
|
private |
Attempts to read chached analysis from file.
- Returns
- whether the read was successful
◆ resampleAudioBuffer()
| AudioBuffer< float > krotos::AudioDataset::resampleAudioBuffer |
( |
const AudioBuffer< float > & | buffer, |
|
|
double | sampleRate, |
|
|
double | targetRate ) |
|
private |
Resamples an AudioBuffer to a target samplerate
- Returns
- the resampled AudioBuffer
◆ run()
| void krotos::AudioDataset::run |
( |
| ) |
|
|
overrideprivate |
Worker thread for analysis.
◆ runAnalysis()
| bool krotos::AudioDataset::runAnalysis |
( |
| ) |
|
|
private |
Checks whether analysis needs to be run.
- Returns
- true or false
◆ sample()
| std::vector< std::pair< std::string, float > > krotos::AudioDataset::sample |
( |
std::string | query, |
|
|
std::size_t | k = 3, |
|
|
bool | descending = true ) const |
Searches for similar files to a query filepath using UCS CatIDs and audio embeddings.
- Parameters
-
| query | filepath used to search for similar files |
| k | the number of search results to return (may return fewer than k) |
| descending | if true, search will be for k most similar |
- Returns
- search results as a vector of pairs, with filepaths and similarity scores
◆ writeCache()
| bool krotos::AudioDataset::writeCache |
( |
| ) |
|
|
private |
Caches the analysis to a json file.
- Returns
- whether the write was successful
◆ CatIDSet
| std::array<std::string, 753> krotos::AudioDataset::CatIDSet |
|
private |
◆ m_dataset
| std::map<std::string, std::vector<std::pair<std::string, std::vector<float> > > > krotos::AudioDataset::m_dataset |
|
private |
◆ m_version
| std::string krotos::AudioDataset::m_version = "1.0" |
|
private |
The documentation for this class was generated from the following files: