Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Read Audio De1 soc

Altera_Forum
Honored Contributor II
928 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