Thanks Jeroen,
I'm only really interested in 700D mode and possibly 2020 where
I'd do the LPCNet routines with another process to recover audio.
Alan VK2ZIW
On Wed, 17 Jun 2020 18:18:25 +0200, Jeroen Vreeken wrote
> It is indeed not in the same header, but it is in the same library.
> You can just add '#include <codec2.h>" to your C file.
>
> The functions use the same 'bits packed in bytes' format, with oneexception:
> a freedv frame might contain multiple codec2 frames (thisdepends on the
> freedv mode)
>
> So suppose you have the data in 'unsigned char rxdata_out[bytes_f];'you can
> decode it with a loop:
>
> struct CODEC2 c2 = freedv_get_codec2(f);
> int bits_per_codec_frame = codec2_bits_per_frame(c2);
> int bytes_per_codec_frame = (bits_per_codec_frame + 7) /8;
> int bits_f = freedv_get_bits_per_codec_frame(f);
> int codec_frames = bits_f / bits_per_codec_frame;
> int samples_per_frame = codec2_samples_per_frame(c2);
>
> int i;
> for (i = 0; i < codec_frames; i++) {
>
> codec2_decode(c2,&speech_out[samples_per_frame*i],&rxdata_out[bytes_per_codec_frame*i]);
> }
>
> On 06/17/2020 01:43 PM, Al Beard wrote:
> Hi Jeroen,
>
>
> It's never easy....
>
>
> 1) codec2_decode() is not definedin freedv_api.h
> 2) codec2_decode() looks to require "bits"not "packed_bits"
>
>
> I'd like not to have to modify the codec2library so my freedv binary
> will run on an updated codec2 library.
>
>
> Al VK2ZIW
>
>
> On Wed, 17 Jun 2020 12:17:04 +0200, JeroenVreeken wrote
> > Hi Al,
> >
> > So you need both the codec2 data and the audio?
> > In that case I would use the freedv_rawdatarx function toget the codec2
> > data.
> > The audio data can be retrieved by callingcodec2_decode() with it, then you
> > have both.
> >
> > If you use the freedv_rawdatarx() function the textcallback functions will
> > still be called in the same manner asif you had used freedv_rx() so that
> > should not be a problem.
> >
> > 73,
> > Jeroen PE1RXQ
> >
> > On 06/17/2020 09:20 AM, Al Beard wrote:
> > Hi Jeroen,
> >
> >
> > I do actually want the decoded audioand the text string.
> > So, should I decode to voice, the700C file saved, after the QSO
> > has finished?
> >
> >
> > As I've mentioned, I'm not a "C"guru but I see a repeater as a very
> > worthwhile
> > project offering a remote areadigital voice communication method for us hams
> > where, unlike the commercial userseg. ambulances who have many bases so
> > HF skip will always (~mostly) getthe signal to/from base HQ.
> >
> >
> > Also, after a callto freedv_rawdatarx() is the text string recovered?
> > It's used to "trigger"retransmission.
> >
> >
> > Alan VK2ZIW
> >
> >
> > On Wed, 17 Jun 2020 02:22:20 +0200,Jeroen Vreeken wrote
> > > You should not mix freedv_rx() withfreedv_rawdatarx().
> > > Either one should be used.
> > > The only difference between the two is thatfreedv_rx() will go one step
> > > further after the modem partand decodes into audio.
> > >
> > > So after the call to freedv_rawdatarx() you aredone and can skip
> > > freedv_rx()
> > >
> > > On 06/16/2020 11:49 PM, Al Beard wrote:
> > > Hi Jeroen,
> > >
> > > In freebeacon.c
> > > Line: 720
> > >
> > > nin = freedv_nin(f);
> > > while (codec2_fifo_read(fifo,demod_in, nin) == 0) {
> > > int nout = 0;
> > > //Alan
> > > ncodecb =freedv_rawdatarx(f, rxdata_out, demod_in);
> > > // original code continues
> > > nout = freedv_rx(f,speech_out, demod_in);
> > > freedv_get_modem_stats(f,&sync, &snr_est);
> > > nin = freedv_nin(f);
> > >
> > > ---------
> > > Can I do this without causing any problems?
> > >
> > > I'm concerned that routines called byfreedv_rx() will have
> > > already processed the demod_in audio data.
> > >
> > > Alan VK2ZIW
> > >
> > > On Tue, 16 Jun 2020 17:58:14 +0200, JeroenVreeken wrote
> > > > Hi Al,
> > > >
> > > > Until recently you would have neededthe freedv_codecrx() and
> > > > freedv_codectx() functions.
> > > > If you have the 'latest greatest' gitversion you will need to use
> > > > freedv_rawdatarx() andfreedv_rawdatatx()
> > > >
> > > > 73,
> > > > Jeroen PE1RXQ
> > > >
> > > > On 06/16/2020 12:42 PM, Al Beard wrote:
> > > > > Hi all,
> > > > >
> > > > > Yes, it's been eighteen monthssince lightning blew my shack
> > > > > radios and computers and now Iwant to use the latest Codec2
> > > > > library code in a repeater.
> > > > >
> > > > > Starting with the "freebeacon"code, I want to retransmit the received
> > > > > 700C data and include the textstring or strings.
> > > > > So the first step is to receivethe "packed data bits".
> > > > >
> > > > > Can somebody point me to afunction in freedv_api.x that will allow
> > > > > getting the "packed data bits" ?
> > > > >
> > > > > (In the past, I had to add afunction.)
> > > > >
> > > > > 73 There is a valve type 73,has anybody used it in a transmitter
> > > > > or receiver?
> > > > >---------------------------------------------------
> > > > > Alan VK2ZIW
> > > > >
> > > > > OpenWebMail 2.53
> > > > >
> > > > >
> > > > >
> > > > >_______________________________________________
> > > > > Freetel-codec2 mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/freetel-codec2
> > > > >
> > > >
> > > >_______________________________________________
> > > > Freetel-codec2 mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/freetel-codec2
> > >
> > >---------------------------------------------------
> > > Alan Beard
> > >
> > > OpenWebMail 2.53
> > >
> > >
> > >
> > >
> > >_______________________________________________
Freetel-codec2 mailing
list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2
> >
> > ---------------------------------------------------
> > Alan Beard
> >
> > OpenWebMail 2.53
> >
> >
> >
> >
> >
> >_______________________________________________
Freetel-codec2 mailing
list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>
> ---------------------------------------------------
> Alan Beard
>
> OpenWebMail 2.53
>
>
>
>
>
>_______________________________________________
Freetel-codec2 mailing
list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2
---------------------------------------------------
Alan Beard
OpenWebMail 2.53
_______________________________________________
Freetel-codec2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2