?? audio.h
字號:
/**********************************************************************MPEG-4 Audio VMAudio i/o moduleThis software module was originally developed byHeiko Purnhagen (University of Hannover / ACTS-MoMuSys)and edited byin the course of development of the MPEG-2 NBC/MPEG-4 Audio standardISO/IEC 13818-7, 14496-1,2 and 3. This software module is animplementation of a part of one or more MPEG-2 NBC/MPEG-4 Audio toolsas specified by the MPEG-2 NBC/MPEG-4 Audio standard. ISO/IEC givesusers of the MPEG-2 NBC/MPEG-4 Audio standards free license to thissoftware module or modifications thereof for use in hardware orsoftware products claiming conformance to the MPEG-2 NBC/ MPEG-4 Audiostandards. Those intending to use this software module in hardware orsoftware products are advised that this use may infringe existingpatents. The original developer of this software module and his/hercompany, the subsequent editors and their companies, and ISO/IEC haveno liability for use of this software module or modifications thereofin an implementation. Copyright is not released for non MPEG-2NBC/MPEG-4 Audio conforming products. The original developer retainsfull right to use the code for his/her own purpose, assign or donatethe code to a third party and to inhibit third party from using thecode for non MPEG-2 NBC/MPEG-4 Audio conforming products. Thiscopyright notice must be included in all copies or derivative works.Copyright (c) 1996, 1999.Header file: audio.h$Id$Required libraries:libtsp.a AFsp audio file libraryRequired modules:common.o common moduleaustream.o audio i/o streams (.au format)Authors:HP Heiko Purnhagen, Uni Hannover <purnhage@tnt.uni-hannover.de>Changes:21-jan-96 HP born (using AFsp-V2R2)19-feb-97 HP made internal data structures invisible30-dec-98 HP uses austream for stdin/stdout, evaluates USE_AFSP07-jan-99 HP AFsp-v4r1 (AFsp-V3R2 still supported)**********************************************************************//**********************************************************************The audio i/o module provides an interface to the basic functions forPCM audio data stream input and output.The current implementation of the audio i/o module is based on theAFsp audio library. If USE_AFSP is undefined, only 16 bit .au filesare supported using the austream module. Audio i/o on stdin/stdout(only 16 bit .au) is also based on the austream module.Other implementations of this module are possible as long as the basicfunctions required by the MPEG-4 Audio VM framework are provided.Optional functions could be substituted by dummy functions andoptional parameters could be ignored. The VM framework uses onlysequential access to the input and output audio data streams. Theseek function is only use for initial compensation of the coding delayin the encoder and decoder.Basic functions and parameters required by the VM framework:AudioOpenRead(): fileName, numChannel, fSampleAudioOpenWrite(): fileName, numChannel, fSampleAudioReadData(): file, data, numSampleAudioWriteData(): file, data, numSampleAudioClose(): fileNOTE: For multi channel audio files, the number of samples per channel (numSample) is used as parameter!!! The total number of samples (numSample*numChannel) is not used here.**********************************************************************/#ifndef _audio_h_#define _audio_h_/* ---------- declarations ---------- */typedef struct AudioFileStruct AudioFile; /* audio file handle *//* ---------- functions ---------- */#ifdef __cplusplusextern "C" {#endif/* AudioInit() *//* Init audio i/o module. *//* formatString options: see AFsp documentation */void AudioInit ( char *formatString, /* in: file format for headerless files */ int debugLevel); /* in: debug level */ /* 0=off 1=basic 2=full *//* AudioOpenRead() *//* Open audio file for reading. */AudioFile *AudioOpenRead ( char *fileName, /* in: file name */ /* "-": stdin (only 16 bit .au) */ int *numChannel, /* out: number of channels */ float *fSample, /* out: sampling frequency [Hz] */ long *numSample); /* out: number of samples in file */ /* (samples per channel!) */ /* or 0 if not available */ /* returns: */ /* audio file (handle) */ /* or NULL if error *//* AudioOpenWrite() *//* Open audio file for writing. *//* Sample format: 16 bit twos complement, uniform quantisation *//* Supported file formats: (matching substring of format) *//* au, snd: Sun (AFsp) audio file *//* wav: RIFF WAVE file *//* aif: AIFF-C audio file *//* raw: headerless (raw) audio file (native byte order) */AudioFile *AudioOpenWrite ( char *fileName, /* in: file name */ /* "-": stdout (only 16 bit .au) */ char *format, /* in: file format (ignored if stdout) */ /* (au, snd, wav, aif, raw) */ int numChannel, /* in: number of channels */ float fSample); /* in: sampling frequency [Hz] */ /* returns: */ /* audio file (handle) */ /* or NULL if error *//* AudioReadData() *//* Read data from audio file. *//* Requested samples that could not be read from the file are set to 0. */long AudioReadData ( AudioFile *file, /* in: audio file (handle) */ float **data, /* out: data[channel][sample] */ /* (range [-32768 .. 32767]) */ long numSample); /* in: number of samples to be read */ /* (samples per channel!) */ /* returns: */ /* number of samples read */ /* (samples per channel!) *//* AudioWriteData() *//* Write data to audio file. */void AudioWriteData ( AudioFile *file, /* in: audio file (handle) */ float **data, /* in: data[channel][sample] */ /* (range [-32768 .. 32767]) */ long numSample); /* in: number of samples to be written */ /* (samples per channel!) *//* AudioSeek() *//* Set position in audio file to curSample. *//* (Beginning of file: curSample=0) *//* NOTE: It is not possible to seek backwards in a output file if *//* any samples were already written to the file. */void AudioSeek ( AudioFile *file, /* in: audio file (handle) */ long curSample); /* in: new position [samples] */ /* (samples per channel!) *//* AudioClose() *//* Close audio file.*/void AudioClose ( AudioFile *file); /* in: audio file (handle) */#ifdef __cplusplus}#endif#endif /* #ifndef _audio_h_ *//* end of audio.h */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -