示例#1
0
static PyObject * py_ogg_oggpack_writecheck(PyObject *self, PyObject *args) {
  int size;
  int c_out;
  oggpack_buffer * b;
  PyArg_ParseTuple(args, "s#", &b, &size);
  c_out = oggpack_writecheck(b);
  return Py_BuildValue("i", c_out);
};
示例#2
0
void rebuilder::rebuild_id_header(
  int channels, int rate, int blocksize_short, int blocksize_long, 
  ogg_packet_holder & packet) {
  
  // Identification header
  oggpack_buffer opb;
  oggpack_writeinit(&opb);

  // Preamble
  oggpack_write(&opb, 0x01, 8);
  oggpack_write_string(&opb, "vorbis");

  // Basic information about the stream.
  oggpack_write(&opb, 0x00, 32);
  oggpack_write(&opb, channels, 8);
  oggpack_write(&opb, rate, 32);

  // Bitrate upper, nominal and lower.
  // All are optional and we do not provide them.
  oggpack_write(&opb, 0, 32);
  oggpack_write(&opb, 0, 32);
  oggpack_write(&opb, 0, 32);

  oggpack_write(&opb, ilog2(blocksize_short), 4);
  oggpack_write(&opb, ilog2(blocksize_long), 4);
  oggpack_write(&opb, 1, 1);

  CHECK(oggpack_writecheck(&opb) == 0);
  
  packet.assign(opb.buffer, oggpack_bytes(&opb));
  packet->b_o_s = 1;
  packet->e_o_s = 0;
  packet->granulepos = 0;
  packet->packetno = 0;
  
  oggpack_writeclear(&opb);
}
示例#3
0
文件: bitwise.c 项目: Chocobo1/ogg
int oggpackB_writecheck(oggpack_buffer *b) {
    return oggpack_writecheck(b);
}
JNIEXPORT jboolean JNICALL Java_org_echocat_jogg_OggPackBufferJNI_writecheck
    (JNIEnv *env, jclass thisClass, jlong handle) {

    return (jboolean) oggpack_writecheck((oggpack_buffer*) handle) == 0;
}