Hello Imran,
Do you have the endianness of the audio going into c2enc/c2dec right? As
written, c2enc and c2dec accept and produce 16 bit signed samples in
whatever the host CPU's endian is; little endian on x86 and most arm chips.
For example, to record and encode some audio on my machine, I'd use the
following commands:
arecord -f S16_LE -r 8k | c2enc 1300 - encoded.c2
note the '-f S16_LE' -- that ensures arecord spits out audio in
little-endian 16 bit signed formed, no wav header.
In the decode direction, I'd use:
c2dec 1300 encoded.c2 - | aplay -f S16_LE -r 8k
To convert from .wav into a format c2enc can consume, I'd use:
sox -t raw -e signed -b 16 -r 8000 speech.wav speech.raw
and from c2dec:
sox -b 16 -e signed -c 1 -r 8000 decoded.raw decoded.wav
Thanks,
Brady O'Brien
On Tue, Jul 19, 2016 at 7:51 PM, David Rowe <[email protected]> wrote:
> Hello Imran,
>
> What mode are you using? There isn't much frame-frame memory in Codec 2
> (e.g. prediction), in modes like 1300 there is none.
>
> Are you sure the bit-alignment remains correct when you remove frames?
>
> - David
>
> On 20/07/16 05:51, Imran wrote:
> > Hi All,
> >
> > I've been experimenting with Codec2 for voice reconstruction. I've
> > found something odd.
> >
> > I have a ~2 second long wav file, 8 Khz, 16 bit pcm, mono. I can encode
> > this file into codec2 no problem.
> > The first 1.3 seconds is silence. The mic is on, but in a quiet room
> > with no noise. The wav file spectogram shows a flat line, near 0, with
> > just a little white noise, for these 1.3 seconds, followed by a quiet
> > envelope of speech sounds.
> >
> > So, I encode the wav file into codec2, decode it and playback. Sounds
> > fine.
> > Then, I start deleting frames at the head of the encoding. So, I delete
> > frame 0, then frame 1 .. frame 15. That's about 300 ms of sound I've
> > removed that has no human sounds in it -- just mic whitenoise.
> >
> > Then, something weird happens.
> > While there's still a lot of silence in the playback, when playback
> > reaches the speech, the voice is noticeably degraded.
> >
> > I can delete 10 frames, no problem. When I delete more than 10,
> > degradation starts, and increases as I delete more frames.
> >
> > Anyone have any hints on why?
> >
> > Thanks,
> > Imran
> >
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and
> traffic
> patterns at an interface-level. Reveals which users, apps, and protocols
> are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning
> reports.http://sdm.link/zohodev2dev
> _______________________________________________
> Freetel-codec2 mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freetel-codec2
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Freetel-codec2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freetel-codec2