Coder Social home page Coder Social logo

lua-deepspeech's Issues

Memory issue with speech:decode()

Hi!
I'm pretty sure this repository is abandoned, but I still wanted to post here since I knew nothing better. I'm trying to use this library along with love2d's mic recording system, but after turning all samples into a table of 16 bit numbers, it just throws this:

...
16375 -143
16376 -101
16377 -69
16378 -39
16379 0
16380 53
16381 112
16382 171
Done with all 16383 samples
malloc(): invalid size (unsorted)
Aborted (core dumped)

Here's my code for decoding all of this:

        local data = recording_device:stop()
        print(data:type())
        if data ~= nil then
            local samples = {}
            for i = 0, data:getSampleCount()-1 do
                local sample = math.floor(data:getSample(i) * 32767)
                print(i .. " " .. sample)
                table.insert(samples, sample)
            end
            print("Done with all " .. data:getSampleCount() ..  " samples")

            local decoded_text = speech.decode(samples)
            print("apparently decoded everything")
            print("command: " .. command)
            print("originally decoded text: " .. decoded_text)
            if type(decoded_text) == "string" then
                command = decoded_text:lower()
                exec_command()
            else
                print("Failed to decode speech")
            end
        end

to be clear, I also initalized the library already.
What did I do wrong?

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.