WebRadioApp  0.1
Collaboration diagram for MP3PLAYER:

Modules

 MP3PLAYER_mp3_variables
 
 MP3PLAYER_fft_variables
 
 MP3PLAYER_audio_buffer
 

Data Structures

struct  AUDIO_OUT_BufferTypeDef
 
class  Mp3Player
 Mp3Player Object. More...
 

Functions

void BSP_AUDIO_OUT_TransferComplete_CallBack (uint32_t Instance)
 Manages the full Transfer complete event. More...
 
void BSP_AUDIO_OUT_HalfTransfer_CallBack (uint32_t Instance)
 Manages the DMA Half Transfer complete event. More...
 
void BSP_AUDIO_OUT_Error_CallBack (uint32_t Instance)
 Manages the DMA FIFO error event. More...
 
 Mp3Player::Mp3Player ()
 Construct a new Mp 3 Player object. More...
 
void Mp3Player::initPlay ()
 Initialize playing. More...
 
void Mp3Player::resume ()
 Mp3 resume play. More...
 
void Mp3Player::bufferProcess ()
 Buffer Process - Refill Filebuffer by extractiong from TCP Ringbuffer. More...
 
void Mp3Player::audioProcess ()
 Decode 2304 Bytes in one step once indicated through. DMA interrupts that they have been consumed (= played out) More...
 
void Mp3Player::insertTcpBuffer (uint8_t *data, uint32_t btw)
 This function is used to close the tcp connection with server. More...
 
void Mp3Player::extractTcpBuffer (uint8_t *data, uint32_t btr)
 This function is used to close the tcp connection with server. More...
 
void Mp3Player::deleteTcpBuffer (void)
 Delete TCP Buffer. More...
 
void Mp3Player::drawFTT (int32_t inx, int32_t *x, int32_t *ly, int32_t ll, int32_t *ry, int32_t rr, int32_t height, int32_t FFTGraph)
 This function generate the parameters to be able to draw a FFT graph. More...
 
void Mp3Player::drawVuMeter (float *angle_L, float *angle_R)
 This function generate the parameters to be able to draw a volume unit meter graph. More...
 
void Mp3Player::getEtherAndBuffer (void)
 It handles the LwIP process and the buffer process. More...
 
void Mp3Player::drawSpectrum (void)
 Draw Spectrum, i.e. FFT graph as computed here Note correct scaling only for 48 kHz sampling frequency! More...
 

Variables

uint32_t fftSize = 1024
 
uint32_t ifftFlag = 0
 
uint32_t doBitReverse = 1
 
uint32_t fftix
 
uint8_t lock_FFT_tansfer
 
int unFramesDecoded
 
int XTAL_Hour
 
int XTAL_Min
 
int XTAL_Sec
 
int currentVolume
 
uint8_t initialaudiovolume
 
static int bytes_left
 
static unsigned char * read_ptr
 
volatile unsigned int br
 
volatile unsigned int btr
 
volatile int offset
 
volatile int err
 
char str [120]
 
int extractsum
 
volatile uint32_t TCP_insert_idx
 
volatile uint32_t TCP_extract_idx
 
uint8_t TCP_Buffer [TCPBUFF_MAXITEMS]
 
int TCP_buff_start
 
int totalsum
 
struct netif gnetif
 
uint8_t file_read_buffer [FILE_READ_BUFFER_SIZE]
 
volatile int items
 
float memoryVU_L
 
float memoryVU_R
 
Mp3Playermp3PlayerInstance
 

MP3 Variables

MP3FrameInfo mp3FrameInfo
 
HMP3Decoder hMP3Decoder
 
int MP3errorcount
 
int MP3errorreason
 
int DMAError
 

FFT Variables

int16_t FFTBuffer [AUDIO_BUFFER_SIZE/2]
 
float32_t FFT_inputstruct_Left [2048]
 
float32_t FFTOutputMagLeft [1024]
 
float32_t FFT_inputstruct_Right [2048]
 
float32_t FFTOutputMagRight [1024]
 

The Audio Buffer

enum  BUFFER_StateTypeDef { BUFFER_OFFSET_NONE = 0, BUFFER_OFFSET_HALF, BUFFER_OFFSET_FULL }
 
 ALIGN_32BYTES (static AUDIO_OUT_BufferTypeDef BufferCtl __attribute__((section(".tcpBuffer"))))
 

Detailed Description

Enumeration Type Documentation

◆ BUFFER_StateTypeDef

Enumerator
BUFFER_OFFSET_NONE 
BUFFER_OFFSET_HALF 
BUFFER_OFFSET_FULL 

Function Documentation

◆ ALIGN_32BYTES()

ALIGN_32BYTES ( static AUDIO_OUT_BufferTypeDef BufferCtl   __attribute__(section(".tcpBuffer")))

needs to be static, otherwise optimizer will interfere!!

◆ audioProcess()

void Mp3Player::audioProcess ( )

Decode 2304 Bytes in one step once indicated through. DMA interrupts that they have been consumed (= played out)

Audio_Process -> Decode 2304 Bytes in one step once indicated through.


DMA interrupts that they have been consumed (= played out)

References AUDIO_BUFFER_SIZE, BUFFER_OFFSET_FULL, BUFFER_OFFSET_HALF, BUFFER_OFFSET_NONE, bytes_left, currentVolume, doBitReverse, err, FFT_inputstruct_Left, FFT_inputstruct_Right, FFTBuffer, FFTOutputMagLeft, FFTOutputMagRight, fftSize, hMP3Decoder, ifftFlag, MP3errorcount, MP3errorreason, mp3FrameInfo, offset, read_ptr, unFramesDecoded, XTAL_Hour, XTAL_Min, and XTAL_Sec.

Here is the caller graph for this function:

◆ BSP_AUDIO_OUT_Error_CallBack()

void BSP_AUDIO_OUT_Error_CallBack ( uint32_t  Instance)

Manages the DMA FIFO error event.

Parameters
None
Return values
None

◆ BSP_AUDIO_OUT_HalfTransfer_CallBack()

void BSP_AUDIO_OUT_HalfTransfer_CallBack ( uint32_t  Instance)

Manages the DMA Half Transfer complete event.

Parameters
None
Return values
None

References AUDIO_BUFFER_SIZE, Mp3Player::audioProcess(), BUFFER_OFFSET_HALF, and mp3PlayerInstance.

Here is the call graph for this function:

◆ BSP_AUDIO_OUT_TransferComplete_CallBack()

void BSP_AUDIO_OUT_TransferComplete_CallBack ( uint32_t  Instance)

Manages the full Transfer complete event.

Parameters
None
Return values
None

References AUDIO_BUFFER_SIZE, Mp3Player::audioProcess(), BUFFER_OFFSET_FULL, and mp3PlayerInstance.

Here is the call graph for this function:

◆ bufferProcess()

void Mp3Player::bufferProcess ( )

Buffer Process - Refill Filebuffer by extractiong from TCP Ringbuffer.


References btr, bytes_left, extractsum, file_read_buffer, FILE_READ_BUFFER_SIZE, read_ptr, and totalsum.

◆ deleteTcpBuffer()

void Mp3Player::deleteTcpBuffer ( void  )

Delete TCP Buffer.


References items, TCP_extract_idx, and TCP_insert_idx.

◆ drawFTT()

void Mp3Player::drawFTT ( int32_t  inx,
int32_t *  x,
int32_t *  ly,
int32_t  ll,
int32_t *  ry,
int32_t  rr,
int32_t  height,
int32_t  FFTGraph 
)

This function generate the parameters to be able to draw a FFT graph.

Parameters
inx
x
ly
ll
ry
rr
height
FFTGraph

References FFTBuffer.

Here is the caller graph for this function:

◆ drawSpectrum()

void Mp3Player::drawSpectrum ( void  )

Draw Spectrum, i.e. FFT graph as computed here Note correct scaling only for 48 kHz sampling frequency!


◆ drawVuMeter()

void Mp3Player::drawVuMeter ( float *  angle_L,
float *  angle_R 
)

This function generate the parameters to be able to draw a volume unit meter graph.

Parameters
angle_L
angle_R

References FFTBuffer, memoryVU_L, and memoryVU_R.

Here is the caller graph for this function:

◆ extractTcpBuffer()

void Mp3Player::extractTcpBuffer ( uint8_t *  data,
uint32_t  btr 
)

This function is used to close the tcp connection with server.

Parameters
datapointer to data to be copied
btrbytes to read
Return values
None

References btr, data, items, TCP_Buffer, TCP_extract_idx, and TCPBUFF_MAXITEMS.

◆ getEtherAndBuffer()

void Mp3Player::getEtherAndBuffer ( void  )

It handles the LwIP process and the buffer process.


References MX_LWIP_Process(), and TCP_buff_start.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initPlay()

◆ insertTcpBuffer()

void Mp3Player::insertTcpBuffer ( uint8_t *  data,
uint32_t  btw 
)

This function is used to close the tcp connection with server.

Parameters
datapointer to data to be copied
btwbytes to write
Return values
None

References data, items, TCP_Buffer, TCP_insert_idx, and TCPBUFF_MAXITEMS.

◆ Mp3Player()

Mp3Player::Mp3Player ( )

Construct a new Mp 3 Player object.


References mp3PlayerInstance.

◆ resume()

void Mp3Player::resume ( )

Variable Documentation

◆ br

volatile unsigned int br

◆ btr

volatile unsigned int btr

◆ bytes_left

int bytes_left
static

◆ currentVolume

int currentVolume

◆ DMAError

int DMAError

◆ doBitReverse

uint32_t doBitReverse = 1

◆ err

volatile int err

◆ extractsum

int extractsum

◆ FFT_inputstruct_Left

float32_t FFT_inputstruct_Left[2048]

◆ FFT_inputstruct_Right

float32_t FFT_inputstruct_Right[2048]

◆ FFTBuffer

int16_t FFTBuffer[AUDIO_BUFFER_SIZE/2]

◆ fftix

uint32_t fftix

◆ FFTOutputMagLeft

float32_t FFTOutputMagLeft[1024]

◆ FFTOutputMagRight

float32_t FFTOutputMagRight[1024]

◆ fftSize

uint32_t fftSize = 1024

◆ file_read_buffer

uint8_t file_read_buffer[FILE_READ_BUFFER_SIZE]

◆ gnetif

struct netif gnetif

◆ hMP3Decoder

HMP3Decoder hMP3Decoder

◆ ifftFlag

uint32_t ifftFlag = 0

◆ initialaudiovolume

uint8_t initialaudiovolume

◆ items

volatile int items

◆ lock_FFT_tansfer

uint8_t lock_FFT_tansfer

◆ memoryVU_L

float memoryVU_L

◆ memoryVU_R

float memoryVU_R

VUMeter Variables

◆ MP3errorcount

int MP3errorcount

◆ MP3errorreason

int MP3errorreason

◆ mp3FrameInfo

MP3FrameInfo mp3FrameInfo

from mp3player.c

◆ mp3PlayerInstance

Mp3Player* mp3PlayerInstance

Mp3Player Variable

◆ offset

volatile int offset

◆ read_ptr

unsigned char* read_ptr
static

◆ str

char str[120]

◆ TCP_buff_start

int TCP_buff_start

State Variable for starting and pausing the buffering

◆ TCP_Buffer

uint8_t TCP_Buffer[TCPBUFF_MAXITEMS]

◆ TCP_extract_idx

volatile uint32_t TCP_extract_idx

◆ TCP_insert_idx

volatile uint32_t TCP_insert_idx

◆ totalsum

int totalsum

◆ unFramesDecoded

int unFramesDecoded

◆ XTAL_Hour

int XTAL_Hour

◆ XTAL_Min

int XTAL_Min

◆ XTAL_Sec

int XTAL_Sec