Giter Club home page Giter Club logo

Comments (2)

cgreening avatar cgreening commented on September 16, 2024

Apologies, I can see what the issue is.

All the samples need to be exactly 1 second long.

The function def is_valid_file(file_name): checks that there are 16000 samples and rejects files that are not the correct length.

This length limit is due to the way the model works - it treats the spectrogram like a 2D image, so can't deal with longer or shorter samples.

There's a couple of options:

Make sure all your files are exactly 1 second in length
Or:
Modify the code so that it truncates the audio file to 1 second and only rejects files that are too short. You would need to make sure you have at least 1 second of data in the file.

You can modify the def is_correct_length(audio, expected_length): to accept files that are >=16000 samples.

And modify the def process_file(file_path): function to something like:

def process_file(file_path):
    # load the audio file
    audio_tensor = tfio.audio.AudioIOTensor(file_path)[0:16000]

I think that will work - I've not tested it though.

from diy-alexa.

mdsuffian avatar mdsuffian commented on September 16, 2024

Brilliant ! it's now capturing perfectly ! : )
image

I trimmed all sound to exact 1 seconds , no more or less.

from diy-alexa.

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.