Displaying 11 results from an estimated 11 matches for "le_short".
2007 Apr 24
3
Re: just noise
...; That still isn't the whole story, and I will explain how it's still
> not working, but first you need to update your example at:
OK I finally figured out the second noise problem. It's a riddle
wrapped in a mystery inside an enigma. Judging by the somewhat odd
structure of le_short() and be_short(), I think this keeps coming up
over and over again. Even Apple's byte swapping macros fail under
certain circumstances, and here's why:
1. Logical shifting must be used, not arithmetic (or else the high
bit is wrong)
2. Conversion from short to float must be signed,...
2007 Apr 24
2
just noise
Hi, I tried both the stable and beta versions of the speex source
code download on Mac OS 10.4.9. I just do:
./configure
make
sudo make install
Then I added libspeex.a from /usr/local/lib and the headers to my
xcode project. My app compiles and I'm able to call all of the speex
functions. I copied the example code from the website and tweaked it
to include the first 10000 bytes of
2007 Apr 24
0
Re: just noise
...h the most
significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#define WORDS_BIGENDIAN 1
unsigned short be_short(unsigned short s)
{
unsigned short ret=s;
#ifndef WORDS_BIGENDIAN
ret = s>>8;
ret += s<<8;
#endif
return ret;
}
unsigned short le_short(unsigned short s)
{
unsigned short ret=s;
#ifdef WORDS_BIGENDIAN
ret = s>>8;
ret += s<<8;
#endif
return ret;
}
////////////////////////////////////////
These functions should really be inline or macros, and I believe the
| operator is faster than + on RISC because it...
2007 Apr 24
0
Re: just noise
> OK I finally figured out the second noise problem. It's a riddle
> wrapped in a mystery inside an enigma. Judging by the somewhat odd
> structure of le_short() and be_short(), I think this keeps coming up
> over and over again. Even Apple's byte swapping macros fail under
> certain circumstances, and here's why:
Funny thing is you seem to be the first to report that... not quite sure
why.
> 1. Logical shifting must be used, not arith...
2004 Aug 06
1
[PATCH] Re: Decoding .spx with 1.0 on ppc produces noise!
...o_fd, SNDCTL_DSP_SETFMT, &format)==-1)
{
perror("SNDCTL_DSP_SETFMT");
@@ -612,7 +612,7 @@
}
/*Convert to short and save to output file*/
for (i=0;i<frame_size*channels;i++)
- out[i]=(short)le_short((short)floor(.5+output[i]));
+ out[i]=(short)floor(.5+output[i]);
#if defined WIN32 || defined _WIN32
if (strlen(outFile)==0)
WIN_Play_Samples (out, sizeof(short) * frame_size*channels);
--- speex-1.0-works/libspeex/nb_celp.c.orig T...
2007 May 02
0
[patch] Mac Universal Binaries
...============================================
> --- src/wav_io.h (revision 12905)
> +++ src/wav_io.h (working copy)
> @@ -35,7 +35,7 @@
> #include <stdio.h>
> #include "speex/speex_types.h"
>
> -#ifdef WORDS_BIGENDIAN
> +#ifdef __BIG_ENDIAN__
> #define le_short(s) ((short) ((unsigned short) (s) << 8) | ((unsigned short) (s) >> 8))
> #define be_short(s) ((short) (s))
> #else
> @@ -46,7 +46,7 @@
> /** Convert little endian */
> static inline spx_int32_t le_int(spx_int32_t i)
> {
> -#ifdef WORDS_BIGENDIAN
> +#ifdef __...
2010 May 03
1
Help decompressing Speex audio
I have an audio file compressed by JSpeex that I'm trying to decompress on the iPhone. I've been trying to work from the speexdec example in an attempt to port the core logic to ObjC. I have a class that does the decode and passes the result back to another class. (currently the other class is a unit test.) My other class is writing the converted output to disk. I compare the results of my
2007 May 02
4
[patch] Mac Universal Binaries
Hi all,
Speex currently decides endianness at configure-time. This causes the
ppc half of Mac universal binaries to have some endianness problems.
Most notably, the header built by speex_packet_to_header() has
incorrect byte-ordering.
This Apple developer page describes the incantation that can be used
to build universal binaries on Mac. It also highlights the
configure-time versus compile-time
2004 Aug 06
4
Decoding .spx with 1.0 on ppc produces noise!
Hi,
I got my hands on the LCA 2003 CD today and I tried to listen to it on
my powerbook running Linux. Instead of getting speech, I got an earfull
of noise! Attempting the same experiment on an i386 with the same CD
produced understandable speech.
It seems that the output routine in speexdec converts the output data to
little endian short format, which is incorrect on the ppc architecture.
The
2008 Apr 04
0
speexdec 1.2.3
...fprintf (stderr, "Bitrate is use: %d bps ", tmp);
}
/*Convert to short and save to output file*/
if (strlen(outFile)!=0)
{
for (i=0;i<frame_size*channels;i++)
out[i]=le_short(output[i]);
} else {
for (i=0;i<frame_size*channels;i++)
out[i]=output[i];
}
{
int frame_offset = 0;
int new_frame_size = frame_size;
/*printf ("packet %d %d...
2008 Apr 04
2
speexdec 1.2.3
On Fri, Apr 4, 2008 at 12:19 AM, Jean-Marc Valin
<jean-marc.valin at usherbrooke.ca> wrote:
> Jahn, Ray (R.) a ?crit :
>
> > Dear Speex codec community:
> >
> > I am working on conversion of voice files. I could not figure out how to use speexdec.exe 1.2.3 in piped mode in order to avoid the creation of the potentially large intermediate *.wav or *.pcm files. Any