Giter VIP home page Giter VIP logo

libg722's People

Contributors

cloppingemu avatar nud avatar pschatzmann avatar sobomax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libg722's Issues

g722.h lost

g722.h is not in usr/local/include after installation
correct building files

test.c is missing

Hello,

The "test.c" file referenced by the "test" Makefile target seems to be missing.

Kind regards,
Steve

With 64bit python, result of G722.decode() is broken.

With 64bit python (3.12.4 amd64), result of G722.decode() is broken.

Reproducible code:

from G722 import G722

while True:
    arr = G722(16000, 64000).decode(b"00")
    print(len(arr))
    assert len(arr) == 4

Result:

PS C:\Users\yukih\Downloads\libg722> .\venv\Scripts\python.exe .\test.py
4   <- expected
140728898420740   <- invalid length
Traceback (most recent call last):
  File "C:\Users\yukih\Downloads\libg722\test.py", line 6, in <module>
    assert len(arr) == 4
           ^^^^^^^^^^^^^
AssertionError

This is caused by sizeof(long) (4) != sizeof(np_intp) (8).

diff --git a/python/G722_mod.c b/python/G722_mod.c
index 10f969e..0d8d3cb 100644
--- a/python/G722_mod.c
+++ b/python/G722_mod.c
@@ -217,7 +217,7 @@ PyG722_decode(PyG722* self, PyObject* args) {
     owner->data = array;

     // Create a new numpy array to hold the integers
-    long dims[1] = {olength};
+    npy_intp dims[1] = {olength};
     PyObject* numpy_array = PyArray_SimpleNewFromData(1, dims, NPY_INT16, (void *)array);
     if (numpy_array == NULL) goto e1;
     PyArray_SetBaseObject((PyArrayObject*)numpy_array, (PyObject*)owner);

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.