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&#39;m using 1 frame per packet.<br><br>Are you sure that i don&#39;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&#39;m getting 8KHz, 8bits mulaw/alaw data and then decoding it to linear pcm (8KHz, 16bits), do you know if it&#39;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">&lt;<a href="mailto:jozsef_vass@yahoo.com">jozsef_vass@yahoo.com</a>&gt;</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>
&gt;<br>
&gt; Message: 2<br>
&gt; Date: Sun, 12 Jul 2009 18:36:28 +0100<br>
&gt; From: Daniel Rosado &lt;<a href="mailto:dsrosado@gmail.com">dsrosado@gmail.com</a>&gt;<br>
&gt; Subject: [Speex-dev] Encoding/Decoding doubts<br>
&gt; To: <a href="mailto:speex-dev@xiph.org">speex-dev@xiph.org</a><br>
&gt; Message-ID:<br>
&gt;     &lt;<a href="mailto:8e6ec0160907121036q29a45285x7964fcb5c6cace2b@mail.gmail.com">8e6ec0160907121036q29a45285x7964fcb5c6cace2b@mail.gmail.com</a>&gt;<br>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<div><div></div><div class="h5">&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m doing a VoIP related project where at some point i need<br>
&gt; to decode speex<br>
&gt; data gathered from a flash client, and then encode it to<br>
&gt; ulaw or alaw pcm so<br>
&gt; i can send it in rtp packets.<br>
&gt; On the other way, i get rtp packets with ulaw and alaw pcm<br>
&gt; data, then i need<br>
&gt; to decode them to linear pcm and feed the speex encoder, so<br>
&gt; i can send the<br>
&gt; data to the flash player.<br>
&gt;<br>
&gt; I&#39;m using JSpeex, i know this is not JSpeex mailing list<br>
&gt; but i would really<br>
&gt; apreciate some help.<br>
&gt;<br>
&gt; There are some (a lot of) things i don&#39;t understand:<br>
&gt;<br>
&gt; -In flash, i can set the sample rate and the quality of the<br>
&gt; speex data. If<br>
&gt; the sample rate is 16KHz, the number of bits per sample,<br>
&gt; and consequently<br>
&gt; the bitrate, will depend on the quality.<br>
&gt; After i get the speex frame, i call init on the Decoder.<br>
&gt; There, i don&#39;t<br>
&gt; understand what is the meaning of the sample rate if you<br>
&gt; already have to<br>
&gt; pass the mode. How is it related?<br>
&gt;<br>
&gt; Does the speex frame contain any info about the bitrate?<br>
&gt;<br>
&gt; -I know that every flash packet has a header containing<br>
&gt; info about the audio<br>
&gt; format, stereo or mono, bitrate, etc. But it seems to<br>
&gt; change over time...For<br>
&gt; example, the number of channels.<br>
&gt;<br>
&gt; -After decoding a speex frame, i&#39;m supposed to get linear<br>
&gt; pcm at what sample<br>
&gt; rate? The same as defined on the init? What about the<br>
&gt; number of bits per<br>
&gt; sample?<br>
&gt;<br>
&gt; -On the speex encoding part, the parameters needed on init<br>
&gt; are related to<br>
&gt; the linear pcm frame i should pass to processData and it<br>
&gt; also indicates what<br>
&gt; type of speex frame i will get?<br>
&gt; What kind of pcm data can i use to feed the encoder?<br>
&gt;<br>
&gt; Maybe some of the questions don&#39;t make much sense, but i<br>
&gt; can&#39;t get much info<br>
&gt; on the subject.<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt;<br>
&gt; John<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br>