用ch376+vs1053做MP3,stm32,读取速度不够,只能让8bit的wav正常播放

unsigned char buf[2048]; unsigned char play() { unsigned long SecCount,FileSize; unsigned char ThisLen; unsigned char s; unsigned int i; FileSize=CH376GetFileSize( ); //获取文件大小 SecCount=FileSize/512; //计算扇区数 if((FileSize%512)!=0) SecCount++; FileSize=SecCount; xEndCH376Cmd( ); do { _initspi_highspeed(); s = CH376SecRead( buf,4, &ThisLen ); //扇区读 SecCount =SecCount+ThisLen; xEndCH376Cmd( ); if(s!=USB_INT_SUCCESS) return 0xff; _initspi_lowspeed(); i=0; GPIO_ResetBits(GPIOC,GPIO_Pin_9); //vs1053片选有效 do { while(GPIO_ReadInputDataBit(GPIOA,GPIO_Pin_11)==0);//DQ for(s=0;s<32;s++) { SPI1_ReadWriteByte(buf[i]); //发送一字节 i++ ; } } while(i!=ThisLen*512); GPIO_SetBits(GPIOC,GPIO_Pin_9); //vs1053片选无效 } while(SecCount!=FileSize) ; return 0x00; }

以上是播放部分代码

请问如何提高读取速度。


你播放要多快的速度?用什么接口与376通讯的


ch376+vs1053 播放320K的mp3是没问题的,建议查一下vs1053的初始化设置


只有登录才能回复,可以选择微信账号登录