高中生
最后登录1970-1-1
在线时间 小时
注册时间2015-7-16
|
芯片已经配置好了,正弦测试也成功了,可是在送音频文件进去后没有声音,求各位大神支招
代码如下:
DIR dirs;
FILINFO finfo;
FATFS FatFs; // Work area (file system object) for logical drive
FIL fsrc, fdst,fsrca; // file objects
BYTE buffer[512]; // file copy buffer
int a = 0;
FRESULT res; // FatFs function common result code
UINT br, bw; // File R/W count
char path[512]="";
uint8_t textFileBuffer[] = "wellcome to use Development board";
void SD_information(void);
FRESULT scan_files (char* path);
FILINFO finfo;
int count;
u8 i;
void mp3_play(void)
{
br = 1;
f_mount(&FatFs,"0:",0);
res = f_open(&fsrc,"1.mp3", FA_OPEN_EXISTING | FA_READ ); /* òÔÖ»¶á·½ê½′ò¿a */
VS_SPI_SpeedHigh(); //¸ßËù
VS_Restart_Play(); //ÖØÆô2¥·Å
VS_Set_All(); //éèÖÃòôá¿μèDÅÏ¢
VS_Reset_DecodeTime(); //ÖØéè½aÂëê±¼ä
for (;;)
{
res = f_read( &fsrc, buffer, sizeof(buffer), &br );
if ( res == 0 )
{
count=0;
while(count<512)
{
while(VS_DQ==0); //ÇëÇóêy¾Y
VS_XDCS=0; /* Ñ¡ÔñVS1003μÄêy¾Y½ó¿ú */
for(i=0;i<32;i++)
{
VS_SPI_ReadWriteByte(buffer[count]);
count++;
}
VS_XDCS=1; /* 1رÕVS1003êy¾Y¶Ë¿ú */
}
}
if (res || br == 0) break;
}
f_close(&fsrc);
f_mount(NULL, "0:", 0);
}
|
|