Hi Jozsef,<br><br>Flash documentation says that when using speex codec, the sample rate by default is 16KHz. Although, it can be changed to 8KHz for example. <br><br>I thought that the number of bits per sample was determined by the sample rate and the quality value.<br>
<br>Yes, i'm using 1 frame per packet.<br><br>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?<br>
<br>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?<br>
<br><br>thank you<br><br><div class="gmail_quote">On Thu, Jul 16, 2009 at 7:05 PM, Jozsef Vass <span dir="ltr"><<a href="mailto:jozsef_vass@yahoo.com">jozsef_vass@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Flash player encodes speex at 16 kHz, mono, 16 bit. Fields <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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.<br>
<br>
Flash player can only decode speex at 16 kHz, so make sure you have the proper sample rate.<br>
<br>
Jozsef<br>
<br>
><br>
> Message: 2<br>
> Date: Sun, 12 Jul 2009 18:36:28 +0100<br>
> From: Daniel Rosado <<a href="mailto:dsrosado@gmail.com">dsrosado@gmail.com</a>><br>
> Subject: [Speex-dev] Encoding/Decoding doubts<br>
> To: <a href="mailto:speex-dev@xiph.org">speex-dev@xiph.org</a><br>
> Message-ID:<br>
> <<a href="mailto:8e6ec0160907121036q29a45285x7964fcb5c6cace2b@mail.gmail.com">8e6ec0160907121036q29a45285x7964fcb5c6cace2b@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="iso-8859-1"<br>
<div><div></div><div class="h5">><br>
> Hi,<br>
><br>
> I'm doing a VoIP related project where at some point i need<br>
> to decode speex<br>
> data gathered from a flash client, and then encode it to<br>
> ulaw or alaw pcm so<br>
> i can send it in rtp packets.<br>
> On the other way, i get rtp packets with ulaw and alaw pcm<br>
> data, then i need<br>
> to decode them to linear pcm and feed the speex encoder, so<br>
> i can send the<br>
> data to the flash player.<br>
><br>
> I'm using JSpeex, i know this is not JSpeex mailing list<br>
> but i would really<br>
> apreciate some help.<br>
><br>
> There are some (a lot of) things i don't understand:<br>
><br>
> -In flash, i can set the sample rate and the quality of the<br>
> speex data. If<br>
> the sample rate is 16KHz, the number of bits per sample,<br>
> and consequently<br>
> the bitrate, will depend on the quality.<br>
> After i get the speex frame, i call init on the Decoder.<br>
> There, i don't<br>
> understand what is the meaning of the sample rate if you<br>
> already have to<br>
> pass the mode. How is it related?<br>
><br>
> Does the speex frame contain any info about the bitrate?<br>
><br>
> -I know that every flash packet has a header containing<br>
> info about the audio<br>
> format, stereo or mono, bitrate, etc. But it seems to<br>
> change over time...For<br>
> example, the number of channels.<br>
><br>
> -After decoding a speex frame, i'm supposed to get linear<br>
> pcm at what sample<br>
> rate? The same as defined on the init? What about the<br>
> number of bits per<br>
> sample?<br>
><br>
> -On the speex encoding part, the parameters needed on init<br>
> are related to<br>
> the linear pcm frame i should pass to processData and it<br>
> also indicates what<br>
> type of speex frame i will get?<br>
> What kind of pcm data can i use to feed the encoder?<br>
><br>
> Maybe some of the questions don't make much sense, but i<br>
> can't get much info<br>
> on the subject.<br>
><br>
> Thanks in advance,<br>
><br>
> John<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br>