Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Read Audio De1 soc

Altera_Forum
Honored Contributor II
1,100 Views

I am starting to using audio functions in DE1 soc. I run the media.c from Monitor Program without any problems. My doubt is that now I am going to integrate with my source code to identify isolated words and all my functions was designed to deal with double data. And in exemple, the data from audio buffer is an int: 

 

 

 

 

 

 

 

volatile int * audio_ptr = (int *) 0xFF203040; // audio port address 

int fifospace, int buffer_index = 0; 

int left_buffer[BUF_SIZE]; 

int right_buffer[BUF_SIZE]; 

... 

fifospace = *(audio_ptr + 1); // read the audio port fifospace register 

if ( (fifospace & 0x000000FF) > 96) // check RARC, for > 75% full 

/* store data until the audio-in FIFO is empty or the memory buffer is full */ 

while ( (fifospace & 0x000000FF) && (buffer_index < BUF_SIZE) ) 

left_buffer[buffer_index] = *(audio_ptr + 2); //Leftdata 

right_buffer[buffer_index] = *(audio_ptr + 3); //Rightdata 

++buffer_index; 

fifospace = *(audio_ptr + 1); // read the audio port fifospace register 

 

I am not sure what I need to do to convert this data to double to integrate properly with my code
0 Kudos
0 Replies
Reply