Skip to content

lkoppenol/tensorflow-nsynth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test workflow Coverage Status License: MIT

Requirements

Tested with Python 3.8

pip install -r requirements.txt

Test

python -m pytest

Example usage

from rimworld.nsynth import io as nsynth_io
from rimworld.nsynth import data_operations as data_ops
from rimworld.nsynth import label_operations as label_ops

THREADS = 8
FILE_PATTERN = "data/nsynth-test.jsonwav/nsynth-test/audio/bass_electronic_*.wav"

nfft = 2048
window = 2048
stride = 512

spectrum = data_ops.Spectrum(nfft=nfft, window=window, stride=stride, log=False)

operations = [
    data_ops.ReadFile(),
    data_ops.DecodeWav(),
    data_ops.Squeeze(),
    data_ops.CastNormalizedFloat(),
    data_ops.GetFirstSecond(),
    label_ops.AllOnes(),
    spectrum.get_encoder()
]

audio_dataset = nsynth_io.audio_dataset_from_pattern(FILE_PATTERN)
for o in operations:
    audio_dataset = audio_dataset.map(o, num_parallel_calls=THREADS)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages