Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ketos ketos
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • public_projects
  • ketosketos
  • Issues
  • #19

Closed
Open
Created Aug 31, 2018 by Oliver Kirsebom@kirsebomOwner

BatchReader class

Batch reader class with below blueprint would be useful to have. Implementation could largely be adapted from filter_analyzer.py

class BatchReader:
    """ Audio file batch reader.

        Reads audio file(s) and serves them in batches.

        Args:
            input: str
                File name, list of file names, or directory name 
            rate: float
                Sampling rate in Hz
            dt_format: str
                Format for parsing date-time data from file names
            overlap: int
                Size of overlap region (number of samples) used for smoothly joining audio signals 
    """
    def __init__(self, input, rate, dt_format=None, overlap=100):
        self.rate = rate
        self.overlap = overlap
        self.index = 0
        self.times = list()
        load(input=input, dt_format=dt_format)

    def load(input, dt_format=None):
        
        if input is file:
            files = [input]
        elif input is list of files:
            files = input
        else: # input is directory
            # find files
        
        if dt_format is not None:
            # attempt to parse date-time data
        
        # sort chronologically

    def next(int max_size=None):
        # loop over files, read and merge, stop when size > max_size
        # return copy of merged signal and update file counter
        # clear local copy of merged signal
        # return None, if there are no more files to read

    def reset()
        self.index = 0
        self.times = list()

    def log():
        # return pandas dataframe with filenames and start times
Edited Aug 31, 2018 by Oliver Kirsebom
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking