sippy / libg722 Goto Github PK
View Code? Open in Web Editor NEWThe ITU G.722 codec, Copyright (C) 2005 Steve Underwood, Copyright (c) CMU 1993 Computer Science, Speech Group Chengxiang Lu and Alex Hauptmann
License: Other
The ITU G.722 codec, Copyright (C) 2005 Steve Underwood, Copyright (c) CMU 1993 Computer Science, Speech Group Chengxiang Lu and Alex Hauptmann
License: Other
g722.h is not in usr/local/include after installation
correct building files
Hello,
The "test.c" file referenced by the "test" Makefile target seems to be missing.
Kind regards,
Steve
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.