[Speex-dev] Encoding/Decoding doubts

Daniel Rosado dsrosado at gmail.com
Thu Jul 16 11:22:30 PDT 2009


Hi Jozsef,

Flash documentation says that when using speex codec, the sample rate by
default is 16KHz. Although, it can be changed to 8KHz for example.

I thought that the number of bits per sample was determined by the sample
rate and the quality value.

Yes, i'm using 1 frame per packet.

Are you sure that i don't need to be careful with the first byte? Should i
include it anyway? I was told that i need to set it, how does flash player
know that encoding of those packets if the stream is created by the server?

Assuming that i really need to use 16KHz, 16bit, mono frames, and that i'm
getting 8KHz, 8bits mulaw/alaw data and then decoding it to linear pcm
(8KHz, 16bits), do you know if it's possible to encode it in 16KHz, 16bit
speex?


thank you

On Thu, Jul 16, 2009 at 7:05 PM, Jozsef Vass <jozsef_vass at yahoo.com> wrote:

>
> Flash player encodes speex at 16 kHz, mono, 16 bit. Fields
>
in the format byte should be ignored if the format is speex. You can set the
> quality by Microphone.encodeQuality (default 6). You can also set the number
> of speex frames per tc message using Microphone.framesPerPacket.
>
> Flash player can only decode speex at 16 kHz, so make sure you have the
> proper sample rate.
>
> Jozsef
>
> >
> > Message: 2
> > Date: Sun, 12 Jul 2009 18:36:28 +0100
> > From: Daniel Rosado <dsrosado at gmail.com>
> > Subject: [Speex-dev] Encoding/Decoding doubts
> > To: speex-dev at xiph.org
> > Message-ID:
> >     <8e6ec0160907121036q29a45285x7964fcb5c6cace2b at mail.gmail.com>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Hi,
> >
> > I'm doing a VoIP related project where at some point i need
> > to decode speex
> > data gathered from a flash client, and then encode it to
> > ulaw or alaw pcm so
> > i can send it in rtp packets.
> > On the other way, i get rtp packets with ulaw and alaw pcm
> > data, then i need
> > to decode them to linear pcm and feed the speex encoder, so
> > i can send the
> > data to the flash player.
> >
> > I'm using JSpeex, i know this is not JSpeex mailing list
> > but i would really
> > apreciate some help.
> >
> > There are some (a lot of) things i don't understand:
> >
> > -In flash, i can set the sample rate and the quality of the
> > speex data. If
> > the sample rate is 16KHz, the number of bits per sample,
> > and consequently
> > the bitrate, will depend on the quality.
> > After i get the speex frame, i call init on the Decoder.
> > There, i don't
> > understand what is the meaning of the sample rate if you
> > already have to
> > pass the mode. How is it related?
> >
> > Does the speex frame contain any info about the bitrate?
> >
> > -I know that every flash packet has a header containing
> > info about the audio
> > format, stereo or mono, bitrate, etc. But it seems to
> > change over time...For
> > example, the number of channels.
> >
> > -After decoding a speex frame, i'm supposed to get linear
> > pcm at what sample
> > rate? The same as defined on the init? What about the
> > number of bits per
> > sample?
> >
> > -On the speex encoding part, the parameters needed on init
> > are related to
> > the linear pcm frame i should pass to processData and it
> > also indicates what
> > type of speex frame i will get?
> > What kind of pcm data can i use to feed the encoder?
> >
> > Maybe some of the questions don't make much sense, but i
> > can't get much info
> > on the subject.
> >
> > Thanks in advance,
> >
> > John
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20090716/99971ba2/attachment.htm 


More information about the Speex-dev mailing list