- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
I am using an Altera DE2 FPGA board and running Quartus II, Nios II (V10.1). I loaded the Terasic V1.6 demo "DE2_SD_Card_Audio." Currently, I can play a .wav file from the SD card to the Line Out. Ignoring all the other details, the C code (hello_led.c) from the demo that outputs to Line Out is: UINT16 Tmp1=0; ... Tmp1=(Buffer[i+1]<<8)|Buffer[i]; //loads the data from the SD card to Tmp1 //change the buffer rate? IOWR(AUDIO_BASE, 0, Tmp1); //sends Tmp1 data to Line Out If I were to print Tmp1, it's basically the points on a sine wave. What I want to do now is fiddle with how the sound plays by changing the play back rate (ideally I want to play the sound up or down an octave, which is just double or half the frequency). Can anyone provide some suggestions on how I can do this in the section: //change the buffer rate? Is it possible in C to write a few lines of code in that section to obtain what I'm looking for? ie. change how fast I'm reading from the Tmp1 buffer to the AUDIO_BASE. Thanks in advance! ~SarengoLink Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here are some options
-simple software delay loop -timer interrupt with a variable interrupt frequency based upon how fast you want to set the DAC -Software writes samples to a FIFO and statemachine, which writes data out to a DAC at a particular output rate specified by the software http://www.dspdimension.com/admin/time-pitch-overview/
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page