Git Product home page Git Product logo

Comments (4)

NLPvv avatar NLPvv commented on July 17, 2024

check your audio
egs:

import argparse
import wave
import os

def short_wav(file_path, duration_threshold):
    with wave.open(file_path, 'rb') as wav_file:
        duration = wav_file.getnframes() / float(wav_file.getframerate())
        return duration < duration_threshold

def find_short_wavs(directory, duration_threshold):
    short_wavs = []
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.endswith('.wav'):
                file_path = os.path.join(root, file)
                if short_wav(file_path, duration_threshold):
                    short_wavs.append(file_path)
    return short_wavs

def main():
    parser = argparse.ArgumentParser(description="Check Audio")
    parser.add_argument("dir", help="search for .wav files")
    parser.add_argument("--threshold", type=float, default=0.4, help="Duration threshold for considering a .wav file short (in seconds)")
    args = parser.parse_args()

    short_wavs = find_short_wavs(args.directory, args.threshold)
    print("Audio wav ".format(args.threshold))
    for file_path in short_wavs:
        print(file_path)

if __name__ == "__main__":
    main()

from funasr.

wjyfelicity avatar wjyfelicity commented on July 17, 2024

已解决,谢谢!

from funasr.

wwfcnu avatar wwfcnu commented on July 17, 2024

已解决,谢谢!

请问你是怎么解决的

from funasr.

wwfcnu avatar wwfcnu commented on July 17, 2024

是因为时长太短了吗

from funasr.

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.