36#include <speex/speex_header.h> 
   39#define BLOCK_SIZE  4096         
   66            if (s->
op.bytes >= 5 && !memcmp(s->
op.packet, 
"Speex", 5)) {
 
   77                "Corrupt or missing data at this page position; continuing...\n");
 
   91                if (ogg_page_serialno(&s->
og) != s->
os.serialno) {
 
   92                    ogg_stream_reset_serialno(&s->
os, ogg_page_serialno(&s->
og));
 
   99                    if (ogg_page_eos(&s->
og) &&
 
  105                    "Invalid page in the bitstream; continuing...\n");
 
  110                    "Corrupt or missing data in bitstream; continuing...\n");
 
  117            ogg_sync_wrote(&s->
oy, bytes);
 
 
  135    SpeexHeader *hdr = 
NULL;
 
  136    int i, 
result, expected_rate;
 
  140    ogg_sync_init(&s->
oy);
 
  144    ogg_sync_wrote(&s->
oy, bytes);
 
  153        ogg_sync_clear(&s->
oy);
 
  157    ogg_stream_init(&s->
os, ogg_page_serialno(&s->
og));
 
  158    if (ogg_stream_pagein(&s->
os, &s->
og) < 0) {
 
  168    hdr = speex_packet_to_header((
char*)s->
op.packet, s->
op.bytes);
 
  169    if (memcmp(hdr->speex_string, 
"Speex   ", 8)) {
 
  173    if (hdr->frames_per_packet != 1) {
 
  174        ast_log(
LOG_ERROR, 
"Only one frame-per-packet OGG/Speex files are currently supported!\n");
 
  177    if (hdr->nb_channels != 1) {
 
  178        ast_log(
LOG_ERROR, 
"Only monophonic OGG/Speex files are currently supported!\n");
 
  181    if (hdr->rate != expected_rate) {
 
  183            hdr->rate, expected_rate);
 
  192    for (i = 0; i < hdr->extra_headers; i++) {
 
  198    speex_header_free(hdr);
 
  203        speex_header_free(hdr);
 
  205    ogg_stream_clear(&s->
os);
 
  206    ogg_sync_clear(&s->
oy);
 
 
  218    ogg_stream_clear(&s->
os);
 
  219    ogg_sync_clear(&s->
oy);
 
 
  297    .
name = 
"ogg_speex16",
 
 
  311    .
name = 
"ogg_speex32",
 
 
Asterisk main include file. File version handling, generic pbx functions.
unsigned int ast_codec_samples_count(struct ast_frame *frame)
Get the number of samples contained within a frame.
#define AST_FRAME_SET_BUFFER(fr, _base, _ofs, _datalen)
#define AST_FRIENDLY_OFFSET
Offset into a frame's data buffer.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
This structure is allocated by file.c in one chunk, together with buf_size and desc_size bytes of mem...
struct ast_frame fr
frame produced by read, typically
struct ast_format_def * fmt
Data structure associated with a single frame of data.
union ast_frame::@239 data
int eos
Indicates whether an End of Stream condition has been detected.
int error(const char *format,...)