1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
/*
* Mp3Splt -- Utility for mp3/ogg splitting without decoding
*
* Copyright (c) 2002-2004 M. Trotta - <matteo.trotta@lib.unimib.it>
*
* http://mp3splt.sourceforge.net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Tested on: GNU/Linux 2.4.20 #2 Mon Mar 17 22:02:15 PST 2003 i686
*/
#ifndef NO_OGG
#ifndef _MP3SPLT_OGG_H
#define _MP3SPLT_OGG_H
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(X) gettext(X)
#else
#define _(X) (X)
#define textdomain(X)
#define bindtextdomain(X, Y)
#endif
#ifdef gettext_noop
#define N_(X) gettext_noop(X)
#else
#define N_(X) (X)
#endif
typedef struct {
int length;
unsigned char *packet;
} v_packet;
typedef struct {
ogg_sync_state *sync_in;
ogg_stream_state *stream_in;
vorbis_dsp_state *vd;
vorbis_block *vb;
int prevW;
ogg_int64_t initialgranpos;
ogg_int64_t len;
ogg_int64_t cutpoint_begin;
struct ssplit *silence_list;
unsigned int serial;
v_packet **packets; /* 2 */
v_packet **headers; /* 3 */
OggVorbis_File vf;
vorbis_comment vc;
FILE *in,*out;
short end;
float off;
double avg_level;
float temp_level;
unsigned long n_stat;
} ogg_state;
ogg_state *ogginfo(FILE *in, ogg_state *state);
int oggsplit(unsigned char *filename, ogg_state *s, float sec_begin, float sec_end, short seekable, short adjust, float threshold);
ogg_state *v_new(void);
void v_free(ogg_state *state);
vorbis_comment *v_comment(vorbis_comment *vc, char *artist, char *album, char *title, char *tracknum, char *date, char *genre, char *comment);
int ogg_scan_silence (ogg_state *state, short seconds, float threshold, float min, short output, ogg_page *page, ogg_int64_t granpos);
#endif
#endif
|