示例#1
0
void PlaySound(uint8 nCode)
{
	if (nCode>=ITEM_COUNT)
		return;


	nMp3StartPos = pAsrItem[nCode].nSoundStart;
	nMp3Size = pAsrItem[nCode].nSoundSize;

	SendString("PlaySound - ");
	SendByteHex(nCode);
	SendLongHex(nMp3StartPos);
	SendLongHex(nMp3Size);
	SendLineEnd();

	LD_Init_MP3();
	LD_AdjustMIX2SPVolume(SPEAKER_VOL);
	LD_play();
}
示例#2
0
int PlayDemoSound_mp3(char *path)
{
	rt_kprintf("PlayDemoSound_mp3 path is %s\r\n",path);
	fd1 = open(path,0,0);
	if(fd1 == -1)
	{
	   close(fd1);
	   return fd1;
	}

	bMp3Play = 1;

	nMp3Size = get_file_size(fd1)-1;

	//将LD3320初始化为播放MP3模式
	LD_Init_MP3();
	//设置耳机音量
	LD_AdjustMIX2SPVolume(7);
	//开始播放
	LD_play();

    return 0;
}