Giter Club home page Giter Club logo

Comments (4)

mthaak avatar mthaak commented on May 28, 2024

It's a sox problem. I changed on line 96 of sox/core.py:
VALID_FORMATS = _get_valid_formats()
to
VALID_FORMATS = ["wav"]
And now I can use Scaper again (with .wav files).

from scaper.

justinsalamon avatar justinsalamon commented on May 28, 2024

@mthaak thanks for posting the issue and for figuring out what the problem is. Have you posted the issue on the pysox repo?

A more general solution would be to check for the OS and use the appropriate command:

import platform

def _get_valid_formats():
    ''' Calls SoX help for a lists of audio formats available with the current
    install of SoX.
    Returns:
    --------
    formats : list
        List of audio file extensions that SoX can process.
    '''
    if NO_SOX:
        return []

    pfm = platform.system()
    if pfm == 'Windows':
        shell_output = subprocess.check_output(
            'sox -h | findstr "AUDIO FILE FORMATS"',
            shell=True)
    else:
        shell_output = subprocess.check_output(
            'sox -h | grep "AUDIO FILE FORMATS"',
            shell=True)

    formats = str(shell_output).strip('\n').split(' ')[3:]
    return formats


VALID_FORMATS = _get_valid_formats()

I don't have access to a windows machine right now so I can't verify that this actually works - @mthaak any chance you can give this a spin? I'm sure @rabitt would be happy to receive a PR :)

from scaper.

mthaak avatar mthaak commented on May 28, 2024

@justinsalamon I have just created an issue on the pysox repo (rabitt/pysox#66) with a solution based on yours.

from scaper.

justinsalamon avatar justinsalamon commented on May 28, 2024

@mthaak great, let's continue the discussion over there.

from scaper.

Related Issues (20)

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.