[Speex-dev] number of samples in input_frame

Jonas Tärnström
2007-06-26T14:54:12Z

<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">


That is a dumb question :)

The encoder expects SPEEX_GET_FRAME_SIZE at all times. If you are
encoding from a fixed length source you must pad the last frame with 0
valued samples.

speexenc / speexdec should provide the sample could you need I guess.

//JT

Thomas Leigh wrote:
<blockquote
 cite="mid12A126661AA6AA468150E23D0A0DFB090F535E@crm.pboro.oak"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html;
">
  <meta name="Generator" content="Microsoft Word 12 (filtered
medium)">

<!--
 /* Font Definitions */
 @font-face
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{font-family:"Cambria
Math";
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsppanose-1:2
4 5 3 5 4 6 3 2 4;}
@font-face
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{font-family:Calibri;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsppanose-1:2
15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{margin:0cm;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspmargin-bottom:.0001pt;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspfont-size:11.0pt;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspfont-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{mso-style-priority:99;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspcolor:blue;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsptext-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{mso-style-priority:99;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspcolor:purple;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsptext-decoration:underline;}
span.EmailStyle17
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{mso-style-type:personal-compose;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspfont-family:"Calibri","sans-serif";
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspcolor:windowtext;}
.MsoChpDefault
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{mso-style-type:export-only;}
@page Section1
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{size:612.0pt
792.0pt;
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspmargin:72.0pt
72.0pt 72.0pt 72.0pt;}
div.Section1
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{page:Section1;}
-->

<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->

Hi all<o:p></o:p>
  <p
class="MsoNormal"><o:p> </o:p>
Sorry if this is a dumb question: does
the
input_frame
passed to speex_encode_int *have* to be frame_size samples
long?<o:p></o:p>
  <p
class="MsoNormal"><o:p> </o:p>
e.g., If I only have 100 samples left to
encode
(which is less
than the frame_size of 160 samples), can I just use an array that
contains 100
samples, or do I need to create an array containing the 100 “real”
samples
plus 60 null samples at the end?<o:p></o:p>
  <p
class="MsoNormal"><o:p> </o:p>
Let me put it one more way for clarity:
is the
response to
SPEEX_GET_FRAME_SIZE a maximum, can I use shorter frames if I
want?<o:p></o:p>
  <p
class="MsoNormal"><o:p> </o:p>
  <p
class="MsoNormal"><o:p> </o:p>
-Thom<o:p></o:p>
  <p
class="MsoNormal"><o:p> </o:p>



_______________________________________________
Speex-dev mailing list
<a class="moz-txt-link-abbreviated"
href="mailto:Speex-dev@xiph.org">Speex-dev@xiph.org
<a class="moz-txt-link-freetext"
href="http://lists.xiph.org/mailman/listinfo/speex-dev">http://lists.xiph.org/mailman/listinfo/speex-dev