/** * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #define REF_COUNT 1 #define DECODE_PACKET 1 extern "C" { #include int _vorbis_unpack_books(vorbis_info *vi, oggpack_buffer *opb); int _vorbis_unpack_info(vorbis_info *vi, oggpack_buffer *opb); int _vorbis_unpack_comment(vorbis_comment *vc, oggpack_buffer *opb); } const uint8_t packInfoData[] = {0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0xBB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBB, 0x01}; unsigned char unpackBookData[] = { 0x1C, 0x42, 0x43, 0x56, 0x02, 0x00, 0x10, 0x00, 0x00, 0x84, 0x74, 0x9A, 0x59, 0xAA, 0x01, 0x22, 0xCC, 0x40, 0x86, 0x81, 0xD0, 0x90, 0x95, 0x00, 0x00, 0x02, 0x00, 0x00, 0x60, 0x84, 0x22, 0x0C, 0x31, 0x20, 0x34, 0x64, 0x25, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x86, 0x92, 0x83, 0x68, 0x42, 0x6B, 0xCE, 0x37, 0xE7, 0x38, 0x68, 0x96, 0x83, 0xA6, 0x52, 0x6C, 0x4E, 0x07, 0x27, 0x52, 0x6D, 0x9E, 0xE4, 0xA6, 0x62, 0x6E, 0xCE, 0x39, 0xE7, 0x9C, 0x73, 0xB2, 0x39, 0x67, 0x8C, 0x73, 0xCE, 0x39, 0xA7, 0x28, 0x67, 0x16, 0x83, 0x66, 0x42, 0x6B, 0xCE, 0x39, 0x27, 0x31, 0x68, 0x96, 0x82, 0x66, 0x42, 0x6B, 0xCE, 0x39, 0xE7, 0x49, 0x6C, 0x1E, 0xB4, 0xA6, 0x4A, 0x6B, 0xCE, 0x39, 0x67, 0x9C, 0x73, 0x3A, 0x18, 0x67, 0x84, 0x71, 0xCE, 0x39, 0xA7, 0x49, 0x6B, 0x1E, 0xA4, 0x66, 0x63, 0x6D, 0xCE, 0x39, 0x67, 0x41, 0x6B, 0x9A, 0xA3, 0xE6, 0x52, 0x6C, 0xCE, 0x39, 0x27, 0x52, 0x6E, 0x9E, 0xD4, 0xE6, 0x52, 0x6D, 0xCE, 0x39, 0xE7, 0x9C, 0x73, 0xCE, 0x39, 0xE7, 0x9C, 0x73, 0xCE, 0x39, 0xA7, 0x7A, 0x71, 0x3A, 0x07, 0xE7, 0x84, 0x73, 0xCE, 0x39, 0x27, 0x6A, 0x6F, 0xAE, 0xE5, 0x26, 0x74, 0x71, 0xCE, 0x39, 0xE7, 0x93, 0x71, 0xBA, 0x37, 0x27, 0x84, 0x73, 0xCE, 0x39, 0xE7, 0x9C, 0x73, 0xCE, 0x39, 0xE7, 0x9C, 0x73, 0xCE, 0x39, 0x27, 0x08, 0x0D, 0x59, 0x09, 0x00, 0x00, 0x01, 0x00, 0x10, 0x84, 0x61, 0x63, 0x18, 0x77, 0x0A, 0x82, 0xF4, 0x39, 0x1A, 0x88, 0x51, 0x84, 0x98, 0x86, 0x4C, 0x7A, 0xD0, 0x3D, 0x3A, 0x4C, 0x82, 0xC6, 0x20, 0xA7, 0x90, 0x7A, 0x34, 0x3A, 0x1A, 0x29, 0xA5, 0x0E, 0x42, 0x49, 0x65, 0x9C, 0x94, 0xD2, 0x09, 0x42, 0x43, 0x56, 0x02, 0x00, 0x80, 0x00, 0x00, 0x10, 0x42, 0x48, 0x21, 0x85, 0x14, 0x52, 0x48, 0x21, 0x85, 0x14, 0x52, 0x48, 0x21, 0x85, 0x18, 0x62, 0x88, 0x21, 0x86, 0x9C, 0x72, 0xCA, 0x29, 0xA8, 0xA0, 0x92, 0x4A, 0x2A, 0xAA, 0x28, 0xA3, 0xCC, 0x32, 0xCB, 0x2C, 0xB3, 0xCC, 0x32, 0xCB, 0x2C, 0xB3, 0x0E, 0x3B, 0xEB, 0xAC, 0xC3, 0x0E, 0x43, 0x0C, 0x31, 0xC4, 0xD0, 0x4A, 0x2B, 0xB1, 0xD4, 0x54, 0x5B, 0x8D, 0x35, 0xD6, 0x9A, 0x7B, 0xCE, 0xB9, 0xE6, 0x20, 0xAD, 0x95, 0xD6, 0x5A, 0x6B, 0xAD, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x82, 0xD0, 0x90, 0x95, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x90, 0x41, 0x06, 0x19, 0x64, 0x14, 0x52, 0x48, 0x21, 0x85, 0x18, 0x62, 0xCA, 0x29, 0xA7, 0x9C, 0x82, 0x0A, 0x2A, 0x20, 0x34, 0x64, 0x25, 0x00, 0x00, 0x06, 0x00, 0xC0, 0x21, 0x67, 0xA0, 0x81, 0x06, 0x1A, 0x68, 0xA0, 0x81, 0x06, 0x1A, 0x68, 0xA0, 0x71, 0xC6, 0x19, 0x88, 0x20, 0x82, 0x08, 0x22, 0xA8, 0xA4, 0x92, 0x4C, 0x3A, 0x0A, 0x29, 0xB5, 0xD8, 0x6A, 0xCC, 0x31, 0xD7, 0x5E, 0x83, 0x0E, 0x3A, 0xF7, 0x9E, 0x7B, 0xEF, 0xB9, 0xF8, 0x1C, 0x84, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0x25, 0x08, 0x0D, 0x59, 0x09, 0x00, 0x80, 0x00, 0x00, 0x00, 0x08, 0x21, 0x84, 0x10, 0x52, 0x48, 0x21, 0x85, 0x14, 0x52, 0x8A, 0x31, 0xC6, 0x1C, 0x73, 0x0E, 0x3A, 0x09, 0x25, 0x04, 0x42, 0x43, 0x56, 0x02, 0x00, 0x60, 0x00, 0x00, 0x0C, 0x31, 0xC4, 0x18, 0x64, 0x90, 0x41, 0x48, 0x21, 0x85, 0x18, 0x62, 0x8A, 0x29, 0xC7, 0x1C, 0x73, 0x0C, 0x3A, 0x08, 0x21, 0x94, 0x52, 0x52, 0x68, 0xA1, 0x85, 0x5C, 0x6A, 0x88, 0x25, 0x96, 0x56, 0x5A, 0x89, 0xA5, 0xA5, 0x98, 0x6A, 0x8B, 0xB1, 0xD6, 0x58, 0x73, 0xED, 0x31, 0xD6, 0xDE, 0x7B, 0xEF, 0xBD, 0xF7, 0xDE, 0x7B, 0xEF, 0xBD, 0xF7, 0xDE, 0x7B, 0xCE, 0x81, 0xD0, 0x90, 0x95, 0x00, 0x40, 0x04, 0x00, 0x00, 0x83, 0x0C, 0x22, 0x88, 0x20, 0x82, 0x8C, 0x31, 0x06, 0x21, 0x04, 0x84, 0x86, 0xAC, 0x04, 0x00, 0x40, 0x00, 0x00, 0x10, 0x62, 0x88, 0x31, 0xC6, 0x20, 0x84, 0x10, 0x52, 0x88, 0x21, 0xA7, 0x9C, 0x82, 0x4C, 0x32, 0xE9, 0xA4, 0xA3, 0x90, 0x02, 0xA1, 0x21, 0x2B, 0x01, 0x00, 0x27, 0x00, 0x00, 0x84, 0x11, 0x47, 0x24, 0x71, 0x04, 0x12, 0x67, 0xA0, 0x81, 0x08, 0x2A, 0xA9, 0x20, 0xA3, 0xCC, 0x42, 0x2C, 0xB1, 0xB5, 0xD6, 0x5A, 0x6B, 0xAD, 0xB5, 0xD6, 0x5A, 0x6B, 0xAD, 0xB5, 0xD6, 0x5A, 0x6B, 0xAD, 0xB5, 0xD6, 0x5A, 0x6B, 0xAD, 0xB5, 0xD6, 0x5A, 0x6B, 0xAD, 0xB5, 0xD6, 0x5A, 0x6B, 0x2D, 0x10, 0x1A, 0xB2, 0x12, 0x00, 0x88, 0x00, 0x00, 0x60, 0x90, 0x41, 0x06, 0x19, 0x44, 0x10, 0x41, 0x04, 0x19, 0x64, 0x80, 0xD0, 0x90, 0x95, 0x00, 0x00, 0x08, 0x00, 0x00, 0x23, 0x8C, 0x40, 0x04, 0x19, 0xA5, 0x14, 0x63, 0x8E, 0x39, 0xE6, 0x18, 0x74, 0xD0, 0x41, 0x27, 0x1D, 0x85, 0x16, 0x5A, 0x20, 0x34, 0x64, 0x25, 0x00, 0xE0, 0x04, 0x00, 0x40, 0x20, 0xA1, 0x88, 0x32, 0xCC, 0x30, 0x04, 0x11, 0x55, 0x54, 0x51, 0x46, 0x15, 0x55, 0x14, 0x52, 0x47, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x94, 0x52, 0x4A, 0x29, 0xA5, 0x54, 0x4A, 0x29, 0xA5, 0x04, 0x42, 0x43, 0x56, 0x02, 0x00, 0x64, 0x00, 0x00, 0x90, 0xA2, 0x94, 0x52, 0x29, 0x2D, 0x45, 0x82, 0x22, 0xA5, 0x18, 0xA4, 0x18, 0x4B, 0x46, 0x15, 0x73, 0x50, 0x5A, 0x8A, 0xA8, 0x72, 0x0C, 0x52, 0xCD, 0xA9, 0x52, 0xCE, 0x20, 0xE6, 0x24, 0x96, 0x88, 0x31, 0x84, 0x94, 0x93, 0x54, 0x32, 0xE6, 0x14, 0x42, 0x0C, 0x42, 0xEA, 0x1C, 0x75, 0x4C, 0x29, 0x06, 0x2D, 0x95, 0x18, 0x42, 0xC6, 0x18, 0xA4, 0xD8, 0x72, 0x4B, 0xA1, 0x73, 0x0E, 0x08, 0x0D, 0x59, 0x21, 0x00, 0x84, 0x66, 0x00, 0x38, 0x1C, 0x07, 0x90, 0x2C, 0x0B, 0x90, 0x2C, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x4D, 0x03, 0x34, 0xCF, 0x03, 0x2C, 0xCD, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0xD3, 0x00, 0xCB, 0xD3, 0x00, 0xCD, 0xF3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x34, 0x0D, 0xD0, 0x3C, 0x0F, 0xD0, 0x3C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0xCF, 0x03, 0x3C, 0x4F, 0x04, 0x3C, 0x51, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCB, 0xF3, 0x00, 0x4D, 0xF4, 0x00, 0x4F, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x34, 0x0D, 0xD0, 0x3C, 0x0F, 0xD0, 0x3C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0xCF, 0x03, 0x3C, 0x51, 0x04, 0x34, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCB, 0xF3, 0x00, 0x4F, 0x14, 0x01, 0x4F, 0xF4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0A, 0x38, 0x00, 0x00, 0x0A, 0x58, 0x08, 0x85, 0x86, 0xAC, 0x08, 0x00, 0xE2, 0x04, 0x00, 0x1C, 0x92, 0x04, 0x49, 0x82, 0x24, 0x41, 0xF3, 0x00, 0x92, 0x65, 0x41, 0xD3, 0xA0, 0x69, 0x30, 0x4D, 0x80, 0x64, 0x59, 0xD0, 0x34, 0x68, 0x1A, 0x4C, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0xD3, 0xA0, 0x69, 0xD0, 0x34, 0x88, 0x22, 0x40, 0xD2, 0x34, 0x68, 0x1A, 0x34, 0x0D, 0xA2, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xA4, 0x69, 0xD0, 0x34, 0x68, 0x1A, 0x44, 0x11, 0x20, 0x69, 0x1A, 0x34, 0x0D, 0x9A, 0x06, 0x51, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x33, 0x4D, 0x88, 0x22, 0x44, 0x11, 0xA6, 0x09, 0xF0, 0x4C, 0x13, 0xA2, 0x08, 0x51, 0x84, 0x69, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x09, 0x1C, 0x00, 0x00, 0x05, 0x4C, 0x28, 0x03, 0x85, 0x86, 0xAC, 0x08, 0x00, 0xE2, 0x04, 0x00, 0x1C, 0x8E, 0x62, 0x59, 0x00, 0x00, 0xE0, 0x38, 0x8E, 0x65, 0x01, 0x00, 0x80, 0xE3, 0x38, 0x96, 0x05, 0x00, 0x00, 0x96, 0x65, 0x89, 0x22, 0x00, 0x00, 0x58, 0x96, 0x26, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x09, 0x1C, 0x00, 0x00, 0x05, 0x4C, 0x28, 0x03, 0x85, 0x86, 0xAC, 0x04, 0x00, 0xA2, 0x00, 0x00, 0x1C, 0x8A, 0x62, 0x59, 0xC0, 0x71, 0x2C, 0x0B, 0x38, 0x8E, 0x65, 0x01, 0x49, 0xB2, 0x2C, 0x80, 0x65, 0x01, 0x34, 0x0F, 0xA0, 0x69, 0x00, 0x51, 0x04, 0x00, 0x02, 0x00, 0x00, 0x0D, 0x1C, 0x00, 0x00, 0x05, 0x6C, 0xD0, 0x94, 0x58, 0x1C, 0xA0, 0xD0, 0x90, 0x95, 0x00, 0x40, 0x14, 0x00, 0x80, 0x41, 0x71, 0x2C, 0x4B, 0xD3, 0x44, 0x91, 0x24, 0x69, 0x9A, 0xE6, 0x89, 0x22, 0x49, 0xD2, 0x34, 0xCF, 0x13, 0x45, 0x9A, 0xE6, 0x79, 0x9E, 0x67, 0x9A, 0xF0, 0x3C, 0xCF, 0x33, 0x4D, 0x88, 0xA2, 0x28, 0x9A, 0x26, 0x44, 0x51, 0x14, 0x4D, 0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 0x2C, 0x03, 0x54, 0xD5, 0x75, 0x5D, 0x57, 0x96, 0x65, 0x19, 0x80, 0xEB, 0xBA, 0xAE, 0x2C, 0xCB, 0xB2, 0x00, 0x00, 0x40, 0x04, 0x07, 0x00, 0x40, 0x01, 0x23, 0xE8, 0x24, 0xA3, 0xCA, 0x22, 0x6C, 0x34, 0xE1, 0xC2, 0x03, 0x50, 0x68, 0xC8, 0x8A, 0x00, 0x20, 0x0A, 0x00, 0x00, 0x30, 0x86, 0x29, 0xC5, 0x94, 0x32, 0x8C, 0x49, 0x08, 0x29, 0x84, 0x86, 0x31, 0x09, 0x21, 0x85, 0x90, 0x49, 0x49, 0xA9, 0xB4, 0x94, 0x2A, 0x08, 0xA9, 0x94, 0x54, 0x4A, 0x05, 0x21, 0x95, 0x92, 0x4A, 0xC9, 0x28, 0xA5, 0x94, 0x5A, 0x4A, 0x15, 0x84, 0x54, 0x4A, 0x2A, 0xA5, 0x82, 0x90, 0x4A, 0x49, 0xA5, 0x14, 0x00, 0x00, 0x8B, 0xE0, 0x00, 0x00, 0x8B, 0x60, 0x21, 0x14, 0x1A, 0xB2, 0x12, 0x00, 0xC8, 0x03, 0x00, 0x20, 0x8C, 0x51, 0x8A, 0x31, 0xC6, 0x9C, 0x93, 0x08, 0x29, 0xC5, 0x98, 0x73, 0xCE, 0x49, 0x84, 0x94, 0x62, 0xCC, 0x39, 0xE7, 0xA4, 0x52, 0x8C, 0x39, 0xE7, 0x9C, 0x73, 0x52, 0x4A, 0xC6, 0x1C, 0x73, 0xCE, 0x39, 0x29, 0xA5, 0x73, 0xCE, 0x39, 0xE7, 0x9C, 0x94, 0x92, 0x39, 0xE7, 0x9C, 0x73, 0x4E, 0x4A, 0xE9, 0x9C, 0x73, 0xCE, 0x39, 0x27, 0xA5, 0x94, 0xD2, 0x39, 0xE7, 0x9C, 0x93, 0x52, 0x4A, 0x09, 0xA1, 0x73, 0xD0, 0x49, 0x29, 0xA5, 0x74, 0xCE, 0x39, 0xE7, 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 0x9C, 0x83, 0x10, 0x42, 0x08, 0x21, 0x84, 0x50, 0x4A, 0xE9, 0x20, 0x84, 0x10, 0x42, 0x08, 0x21, 0x84, 0x12, 0x4A, 0x29, 0x29, 0x85, 0x10, 0x42, 0x08, 0x21, 0x84, 0x10, 0x42, 0x2A, 0x29, 0xA5, 0x10, 0x42, 0x08, 0xA1, 0x94, 0x10, 0x4A, 0x48, 0x25, 0xA5, 0x14, 0x42, 0x08, 0x21, 0x84, 0x50, 0x4A, 0x09, 0x29, 0xA5, 0x94, 0x42, 0x08, 0xA1, 0x94, 0x10, 0x42, 0x28, 0x21, 0xA5, 0x94, 0x52, 0x4A, 0x21, 0x84, 0x10, 0x42, 0x29, 0xA5, 0xA4, 0x94, 0x52, 0x4A, 0xA9, 0x84, 0x52, 0x42, 0x09, 0xA1, 0x84, 0x54, 0x4A, 0x4A, 0x29, 0x85, 0x12, 0x42, 0x08, 0xA5, 0x94, 0x92, 0x52, 0x4A, 0x29, 0x95, 0x52, 0x42, 0x28, 0xA1, 0x84, 0x52, 0x4A, 0x49, 0x29, 0xA5, 0x94, 0x52, 0x08, 0x21, 0x84, 0x52, 0x4A, 0x01, 0x00, 0x80, 0x08, 0x0E, 0x00, 0x80, 0x02, 0x46, 0xD0, 0x49, 0x46, 0x95, 0x45, 0xD8, 0x68, 0xC2, 0x85, 0x07, 0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x20, 0x08, 0x91, 0x19, 0x22, 0x51, 0xB0, 0x00, 0x0C, 0x0E, 0x54, 0x00, 0x42, 0xC2, 0x14, 0x00, 0x50, 0x58, 0x60, 0x90, 0x03, 0x00, 0x0D, 0x0E, 0x0F, 0x69, 0x17, 0x17, 0xD0, 0x65, 0x80, 0x0B, 0xBA, 0xB8, 0xEB, 0x40, 0x08, 0x41, 0x08, 0x42, 0x10, 0x8B, 0x03, 0x28, 0x20, 0x01, 0x07, 0x27, 0xDC, 0xF0, 0xC4, 0x1B, 0x9E, 0x70, 0x83, 0x13, 0x74, 0x8A, 0x4A, 0x0D, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x80, 0x00, 0x00, 0x24, 0x0F, 0x40, 0x44, 0x44, 0x34, 0x73, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x00, 0x00, 0x80, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08}; unsigned char bufData[] = { 0x3E, 0x79, 0xDE, 0x36, 0x88, 0xA9, 0x82, 0x16, 0xA4, 0x10, 0x4E, 0x70, 0x83, 0x90, 0xA3, 0x4C, 0x94, 0xA9, 0xF3, 0x81, 0x46, 0x74, 0x15, 0x42, 0x0B, 0x42, 0x08, 0xC7, 0xB8, 0x41, 0x28, 0x23, 0x24, 0xF4, 0xA3, 0x28, 0xCB, 0xA2, 0x28, 0xCB, 0xA2, 0x28, 0xCB, 0xA2, 0x28, 0xCB, 0x02, 0x00, 0x60, 0x37, 0xB9, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xF0, 0xDE, 0xAA, 0x88, 0xAA, 0x08, 0x84, 0x14, 0x23, 0x33, 0x2A, 0x35, 0x85, 0x04, 0x78, 0x7B, 0x95, 0x58, 0x4E, 0xB3, 0x6A, 0x69, 0x69, 0x61, 0x66, 0x61, 0x6E, 0x69, 0x62, 0x66, 0x9A, 0x30, 0x41, 0x82, 0xF8, 0x84, 0x71, 0x71, 0xB1, 0xF1, 0x31, 0x31, 0xB1, 0xB1, 0x31, 0x31, 0xB1, 0x3D, 0x3b, 0x3D, 0xBA, 0xDD, 0x4E, 0xA7, 0xDB, 0xED, 0x74, 0xBA, 0xDD, 0xa6, 0xD3, 0x76, 0x9b, 0x4E, 0xDB, 0x6D, 0x3a, 0x6D, 0xDB, 0x34, 0x6D, 0xD3, 0x34, 0xED, 0xCB, 0x57, 0x2F, 0x5F, 0xBD, 0x3C, 0xF4, 0x43, 0x3F, 0xF4, 0x43, 0x3F, 0xF4, 0xE3, 0xF1, 0xE3, 0xC7, 0x8F, 0x1F, 0x3F, 0x7E, 0xFC, 0xF8, 0xF1, 0xE3, 0xC7, 0x8F, 0x1F, 0x3F, 0x7E, 0xFC, 0xF8, 0xF1, 0xE3, 0xC7, 0xF1, 0xD1, 0x68, 0x34, 0x1A, 0x8D, 0x46, 0xA3, 0xD1, 0x68, 0x34, 0x0A}; static void makeBitReader(const void *data, size_t size, ogg_buffer *buf, ogg_reference *ref, oggpack_buffer *bits) { buf->data = (uint8_t *)data; buf->size = size; buf->refcount = REF_COUNT; ref->buffer = buf; ref->length = size; oggpack_readinit(bits, ref); } int main() { ogg_buffer buf; ogg_reference ref; oggpack_buffer bits; memset(&buf, 0, sizeof(ogg_buffer)); memset(&ref, 0, sizeof(ogg_reference)); memset(&bits, 0, sizeof(oggpack_buffer)); makeBitReader(packInfoData, sizeof(packInfoData), &buf, &ref, &bits); vorbis_info *mVi = new vorbis_info; vorbis_info_init(mVi); int ret = _vorbis_unpack_info(mVi, &bits); if (!ret) { memset(&buf, 0, sizeof(ogg_buffer)); memset(&ref, 0, sizeof(ogg_reference)); memset(&bits, 0, sizeof(oggpack_buffer)); makeBitReader(unpackBookData, sizeof(unpackBookData), &buf, &ref, &bits); ret = _vorbis_unpack_books(mVi, &bits); if (!ret) { ogg_packet pack; memset(&pack, 0, sizeof(ogg_packet)); memset(&buf, 0, sizeof(ogg_buffer)); memset(&ref, 0, sizeof(ogg_reference)); vorbis_dsp_state *mState = new vorbis_dsp_state; vorbis_dsp_init(mState, mVi); buf.data = bufData; buf.size = sizeof(bufData); buf.refcount = REF_COUNT; ref.buffer = &buf; ref.length = buf.size; pack.packet = &ref; pack.bytes = ref.length; vorbis_dsp_synthesis(mState, &pack, DECODE_PACKET); } } return EXIT_SUCCESS; }