⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 audiobuffer.h

📁 本程序为ST公司开发的源代码
💻 H
字号:
/************************************************** * * audiobuffer.h * * CVS ID:   $Id: audiobuffer.h,v 1.26 2007/01/30 13:57:02 marcucci Exp $ * Author:   Raffaele Belardi [RB] - STM * Date:     $Date: 2007/01/30 13:57:02 $ * Revision: $Revision: 1.26 $ *  * Description: *  * API for AudioBuffer access *  *************************************************** *  * COPYRIGHT (C) ST Microelectronics  2005 *            All Rights Reserved * *************************************************** * *  \brief        Audio buffer * *  \par          Change History: * * - BB060926a    Fixed CD exchange (WUT74-18-102531) * ****************************************************************************** * * STM CVS Log: * * $Log: audiobuffer.h,v $ * Revision 1.26  2007/01/30 13:57:02  marcucci * 16/32 SRC run-time selection * * Revision 1.25  2006/11/02 12:10:33  chlapik * - checked all global variables used by DMA CH0 interrupt and DEC or CTR task - disable/enable scheduling/interrupts used for protection * - functions AudioBufferResetPosition() and ResetAudioBuffer() check if DMA xfer is not active, only then do the modification of AB variables * - CDDA - repeat of last xfer: * 		- mark AB element used for repeat xfer as not empty in order that DEC doesn't reconfigure SRC, DMA, OIF * 		- after repeated xfer is finished, if new data available, start DMA xfer again, but set source address correctly, not one from previous xfer * * Revision 1.24  2006/10/09 13:36:18  belardi * Merge of m8_cav2_cm80507 - created new AudioBufferResetPosition() function * * Revision 1.23  2006/09/18 09:55:21  belardi * Corrected CVS keyword usage * * Revision 1.22  2006/09/18 09:23:01  belardi * Added Log CVS keyword into file header * * ***************************************************/#ifndef _AUDIOBUFFER_H_#define _AUDIOBUFFER_H_#include "configuration.h"#include "decoder_defines.h"#include "xdefines.h"#include "events.h"typedef enum AudioBufferStatus_tag {	abDataReady,	abEmpty,	abTransferInProgress,	abTransferComplete,	abError,	abDummy = 0xFFFF} AudioBufferStatus;#if (0 == HAVE_SHOCK_MEMORY)#define AudioBufferElements			2#endif/* IN SAMPLES */#if   (HAVE_WMA==0) && (HAVE_AAC==0) #define AUDIO_BUFFER_ELEMENT_LENGTH	(576*2)#elif (HAVE_WMA==0) && (HAVE_AAC==1) #define AUDIO_BUFFER_ELEMENT_LENGTH	(2600*2)#else /*HAVE_WMA*/ #if (HAVE_SHOCK_MEMORY==0)  #define AB_UNDERFLOW_LIMIT			32			// [LL]  #define AUDIO_BUFFER_ELEMENT_LENGTH	(576*2) #else /*HAVE_SHOCK_MEMORY*/  #define AB_UNDERFLOW_LIMIT			400			// [LL]  #define AUDIO_BUFFER_ELEMENT_LENGTH	(2600*2)	//(2200*2)	// [LL] #endif /*HAVE_SHOCK_MEMORY*/#endif /*HAVE_WMA*///#ifdef WMA_PCM32typedef int AudioBufferData;//#else//typedef short AudioBufferData;//#endiftypedef AudioBufferData *pAudioBufferData;//[MM] Prepare AudioBuffer for SRC 16 bit interface.//[MM] it is important to have AudioBufferData at 4 bytes //[MM] boundarytypedef struct AudioBuffer_tag {// AudioBufferStatus status;//#if (HAVE_SHOCK_MEMORY!=0)//	AudioBufferData *data;//#else	AudioBufferData data[AUDIO_BUFFER_ELEMENT_LENGTH];//#endif /*HAVE_SHOCK_MEMORY*/  AudioBufferStatus status;  uint32 DataLength;  ElementFlagType ElementFlag;  tDecoderTime_event TimeEvent;  t_position Position;  uint16 Bitrate;} AudioBufferElement;pAudioBufferData AudioBufferHaveSpace(eDecoderSampleRate SampleRate);void AudioBufferInit(void);void ResetAudioBuffer(void);pAudioBufferData AudioBufferRead(uint32 *);void AudioBufferSetFull(uint32 num_samples, ElementFlagType ElementFlag, tDecoderTime_event *TimeEvent, t_position *Position);uint32 CIF_reconf(uint32 enable);void start_dma0_xfer(void);t_position AB_GetPlayedPosition(void);uint32 AB_GetPlayedOffset(void);t_XItem AB_GetPlayedXfile(void);t_position AB_GetCurrentPosition(void);uint16 AB_GetPlayedBitrate(void);uint16 AB_GetCurrentBitrate(void);void AudioBufferResetPosition(void);  /* BB060926a */#if (0 == HAVE_SHOCK_MEMORY)extern AudioBufferElement AudioBuffer[];#elseextern AudioBufferElement *AudioBuffer;     //[MM]extern uint32 AudioBufferElements;          //[MM]#endifextern volatile int g_ABempty;extern volatile short g_AudioBufferReadFrom;#endif //_AUDIOBUFFER_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -