GithubHelp home page GithubHelp logo

psibre / gradle-flaml-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from m2ci-msp/gradle-flaml-plugin

0.0 2.0 0.0 453 KB

Utility plugin to manage speech data following FLAC+YAML convention

License: GNU Lesser General Public License v3.0

Groovy 93.09% Praat 6.91%

gradle-flaml-plugin's Introduction

Gradle FLAML Plugin

CI License: LGPL v3

A utility plugin for Gradle, allowing lightweight management of speech data in FLAC format and corresponding metadata in YAML format (see below).

Prerequisites

Java (8 or newer) and SoX must be installed. FLAC must be installed for testing.

Plugin Usage

See https://plugins.gradle.org/plugin/org.m2ci.msp.flaml

Configuration

This plugin adds a flaml extension, which is configured with the (relative) paths to a FLAC and YAML file like this:

flaml {
  flacFile = 'foobar.flac'
  yamlFile = 'foobar.yaml'
}

FLAML Tasks

Applying this plugin to a project adds several tasks, which are configured as follows.

extractLabFiles - Extracts XWaves lab files from YAML

Inputs

  • yamlFile, default: flaml.yamlFile

Outputs

  • destDir, default: layout.buildDirectory.dir('lab')

extractTextFiles - Extracts text files from YAML

Inputs

  • yamlFile, default: flaml.yamlFile

Outputs

  • destDir, default: layout.buildDirectory.dir('text')

extractTextGrid - Converts YAML to single Praat TextGrid file

Inputs

  • flacFile, default: flaml.flacFile
  • yamlFile, default: flaml.yamlFile

Outputs

  • textGridFile, default: layout.buildDirectory.file("${project.name}.TextGrid")

extractWavFiles - Extracts WAV files from FLAC+YAML

Inputs

  • flacFile, default: flaml.flacFile
  • yamlFile, default: flaml.yamlFile

Outputs

  • destDir, default: layout.buildDirectory.dir('wav')

generateComments - Generates comments as Properties file

Inputs

  • properties, default: (empty)

Outputs

  • destFile, default: layout.buildDirectory.file('comments.properties')

generateFlac - Generates FLAC from WAV file collection

Inputs

  • srcFiles, default: layout.buildDirectory.dir('wav')
  • commentsFile, default: generateComments.destFile

Outputs

  • flacFile, default: layout.buildDirectory.file("${project.name}.flac")

generateYaml - Generates YAML from WAV file collection

Inputs

  • srcFiles, default: generateFlac.srcFiles
  • commentsFile, default: generateComments.destFile

Outputs

  • yamlFile, default: layout.buildDirectory.file("${project.name}.yaml")

generateYamlFromTextGrid - Generates YAML from TextGrid

Inputs

  • srcFile, default: extractTextGrid.textGridFile

Outputs

  • yamlFile, default: layout.buildDirectory.file("${project.name}.yaml")

injectSegments - Injects lab files into YAML

Inputs

  • labDir, default: extractLabFiles.destDir
  • yamlSrcFile, default: flaml.yamlFile

Outputs

  • yamlDestFile, default: layout.buildDirectory.file("${project.name}.yaml")

injectText - Injects text files into YAML

Inputs

  • textDir, default:, extractTextFiles.destDir
  • yamlSrcFile, default: flaml.yamlFile

Outputs

  • yamlDestFile, default: layout.buildDirectory.file("${project.name}.yaml")

FLAML (FLAC+YAML) Convention

The FLAML convention assumes a FLAC file and corresponding YAML file describing its contents.

The YAML file is expected to contain a list of utterances, each of which is a map that must have

  • a prompt key, where the prompt is used as the basename for individual utterance files
  • a text key, containing the orthographic text contents of the utterance
  • a start key providing the start time (in seconds) of the utterance in the FLAC file
  • an end key, providing the end time (in seconds) of the utterance in the FLAC file
  • optionally a segments key, providing a list of segments in the utterance, where each segment is a map that must have
    • a lab key, providing the label of the segment
    • a dur key, providing the duration (in seconds) of the segment

Below is an example:

- prompt: foo
  text: Foo.
  start: 0.1
  end: 0.4
  segments:
  - lab: f
    dur: 0.1
  - lab: u
    dur: 0.2
- prompt: bar
  text: Bar.
  start: 0.6
  end: 0.9
  segments:
  - lab: b
    dur: 0.1
  - lab: a
    dur: 0.1
  - lab: r
    dur: 0.1

gradle-flaml-plugin's People

Contributors

psibre avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.