fixed bindings
parent
6d8c6222a6
commit
b2e7eea8cd
|
|
@ -12,7 +12,7 @@
|
|||
install(FILES
|
||||
api.h
|
||||
codec2_encoder.h
|
||||
#codec2_decoder.h
|
||||
codec2_decoder.h
|
||||
symbol_sync.h
|
||||
m17_coder.h
|
||||
m17_decoder.h DESTINATION include/gnuradio/m17
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
/* -*- c++ -*- */
|
||||
/*
|
||||
* Copyright 2026 wkaczmarski.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_M17_CODEC2_DECODER_H
|
||||
#define INCLUDED_M17_CODEC2_DECODER_H
|
||||
|
||||
#include <gnuradio/block.h>
|
||||
#include <gnuradio/m17/api.h>
|
||||
|
||||
namespace gr
|
||||
{
|
||||
namespace m17
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief <+description of block+>
|
||||
* \ingroup m17
|
||||
*
|
||||
*/
|
||||
class M17_API codec2_decoder : virtual public gr::block
|
||||
{
|
||||
public:
|
||||
typedef std::shared_ptr<codec2_decoder> sptr;
|
||||
|
||||
/*!
|
||||
* \brief Return a shared_ptr to a new instance of m17::m17_coder.
|
||||
*
|
||||
* To avoid accidental use of raw pointers, m17::m17_coder's
|
||||
* constructor is in a private implementation
|
||||
* class. m17::m17_coder::make is the public interface for
|
||||
* creating new instances.
|
||||
*/
|
||||
static sptr make();
|
||||
};
|
||||
|
||||
} // namespace m17
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_M17_CODEC2_DECODER_H */
|
||||
|
|
@ -15,7 +15,7 @@ list(APPEND m17_sources
|
|||
m17_coder_impl.cc
|
||||
m17_decoder_impl.cc
|
||||
codec2_encoder_impl.cc
|
||||
#codec2_decoder_impl.cc
|
||||
codec2_decoder_impl.cc
|
||||
#symbol_sync_impl.cc
|
||||
../libm17/m17.c
|
||||
../libm17/decode/symbols.c
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace gr
|
|||
return 0;
|
||||
|
||||
// decode exactly one frame
|
||||
codec2_decode(&c2, bits, const_cast<int16_t *>(speech));
|
||||
codec2_decode(&c2, const_cast<int16_t *>(speech), bits );
|
||||
|
||||
// consume 160 samples
|
||||
consume_each(CODEC2_SAMPLES_PER_FRAME);
|
||||
|
|
@ -32,7 +32,7 @@ list(APPEND m17_python_files
|
|||
m17_coder_python.cc
|
||||
m17_decoder_python.cc
|
||||
codec2_encoder_python.cc
|
||||
#codec2_decoder_python.cc
|
||||
codec2_decoder_python.cc
|
||||
#symbol_sync_python.cc
|
||||
python_bindings.cc
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright 2025 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GNU Radio
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
*/
|
||||
|
||||
/***********************************************************************************/
|
||||
/* This file is automatically generated using bindtool and can be manually
|
||||
* edited */
|
||||
/* The following lines can be configured to regenerate this file during cmake */
|
||||
/* If manual edits are made, the following tags should be modified accordingly.
|
||||
*/
|
||||
/* BINDTOOL_GEN_AUTOMATIC(0) */
|
||||
/* BINDTOOL_USE_PYGCCXML(0) */
|
||||
/* BINDTOOL_HEADER_FILE(codec2_decoder.h) */
|
||||
/* BINDTOOL_HEADER_FILE_HASH(1b2f013e25a1c90973f41cab79e6251f) */
|
||||
/***********************************************************************************/
|
||||
|
||||
#include <pybind11/complex.h>
|
||||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
#include <gnuradio/m17/codec2_decoder.h>
|
||||
// pydoc.h is automatically generated in the build directory
|
||||
//#include <codec2_decoder_pydoc.h>
|
||||
|
||||
void bind_codec2_decoder(py::module &m) {
|
||||
|
||||
using codec2_decoder = ::gr::m17::codec2_decoder;
|
||||
|
||||
py::class_<codec2_decoder, gr::block, gr::basic_block, std::shared_ptr<codec2_decoder>>(
|
||||
m, "codec2_decoder", "Codec2 decoder block")
|
||||
|
||||
.def(py::init(&codec2_decoder::make), "Create a Codec2 decoder")
|
||||
|
||||
;
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ namespace py = pybind11;
|
|||
void bind_m17_coder(py::module& m);
|
||||
void bind_m17_decoder(py::module& m);
|
||||
void bind_codec2_encoder(py::module& m);
|
||||
//void bind_codec2_decoder(py::module& m);
|
||||
void bind_codec2_decoder(py::module& m);
|
||||
//void bind_symbol_sync(py::module& m);
|
||||
// ) END BINDING_FUNCTION_PROTOTYPES
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ PYBIND11_MODULE(m17_python, m)
|
|||
bind_m17_coder(m);
|
||||
bind_m17_decoder(m);
|
||||
bind_codec2_encoder(m);
|
||||
//bind_codec2_decoder(m);
|
||||
bind_codec2_decoder(m);
|
||||
//bind_symbol_sync(m);
|
||||
// ) END BINDING_FUNCTION_CALLS
|
||||
}
|
||||
Loading…
Reference in New Issue