最近公司想做一款类似儿童早教机的产品,
请大家不吝推荐
离线
软解或者加超贵的vs1053
那有mp3解码库推荐吗?
离线
https://www.helixcommunity.org/projects/datatype/mp3dec
fixed-point
试一试这个:
Memory Usage
ROM = 13446 Bytes (const globals)
RAM = 23816 Bytes (heap)
Total Data Memory = 37262 Bytes
Code Size = 21000 Bytes (approximately - depends on compiler)
离线
可以先在Windows下用电脑编译试一试, 毕竟MSVC调试更方便。
离线
可以先在Windows下用电脑编译试一试, 毕竟MSVC调试更方便。
搞定mp3解码, 抄的, 编译环境MSVC2015, 有需要的拿去用吧.
#define READBUF_SIZE 4000
char readBuf[READBUF_SIZE];
short output[READBUF_SIZE*10];int main()
{
HMP3Decoder hMP3Decoder;
MP3FrameInfo mp3FrameInfo;
hMP3Decoder = MP3InitDecoder();
if (hMP3Decoder == 0)
{
// This means the memory allocation failed. This typically happens if there is not
// enough heap memory. Recompile the code with additional heap memory.
while (1);
}char* input = &readBuf[0];
FILE* mp3File = fopen("d:\\tkzc.mp3", "rb");
/* Reset counters */
int bytesLeft = 0;
int outOfData = 0;
char* readPtr = readBuf;int br = fread(readBuf, 1, READBUF_SIZE, mp3File);
bytesLeft += br;if ((br <= 0)) return -1;
while (1)
{
/* find start of next MP3 frame - assume EOF if no sync found */
int offset = MP3FindSyncWord(readPtr, bytesLeft);
if (offset < 0)
{
outOfData = 1;
break;
}
else
{
readPtr += offset; //data start point
bytesLeft -= offset; //in buffer
int errs = MP3Decode(hMP3Decoder, &readPtr, &bytesLeft, output, 0);if (bytesLeft < READBUF_SIZE)
{
memmove(readBuf, readPtr, bytesLeft);
int br = fread(readBuf + bytesLeft, 1, READBUF_SIZE - bytesLeft, mp3File);
if ((br <= 0)) break;if (br < READBUF_SIZE - bytesLeft)
memset(readBuf + bytesLeft + br, 0, READBUF_SIZE - bytesLeft - br);
bytesLeft = READBUF_SIZE;
readPtr = readBuf;
}MP3GetLastFrameInfo(hMP3Decoder, &mp3FrameInfo);
}
}
fclose(mp3File);}
离线
好帖好帖,软解码mp3有着落了
离线