1 | /* Zusatzinfos!
|
2 | static tWaveFileInfo g_psWaveFiles[5u];
|
3 | static tWaveHeader g_sWaveHeader;
|
4 |
|
5 | CPU_INT08S pcFilename[16];
|
6 | CPU_INT32U *pucFilePtr;
|
7 |
|
8 | tWaveReturnCode BSP_WaveOpen(CPU_INT32U *pulAddress, tWaveHeader *pWaveHeader);
|
9 | void BSP_WavePlay(tWaveHeader *pWaveHeader);
|
10 | */
|
11 |
|
12 | /* (1) Get pointers to the WAV files. */
|
13 | g_psWaveFiles[0].pucFilePtr = __section_begin("wave_1");
|
14 |
|
15 | /* (2) Name the files. */
|
16 | sprintf(g_psWaveFiles[0].pcFilename, "Auto");
|
17 |
|
18 | /* (3) Set the pointer to the first wave in the list.*/
|
19 | g_ucCurrentWaveIdx = 0;
|
20 | strcpy(pcCurrentWaveTitle, g_psWaveFiles[0].pcFilename);
|
21 |
|
22 | /* (4)
|
23 | *********************************************************************************************************
|
24 | * Description : This function can be used to test if a file is a wav file or not and will
|
25 | * also return the wav file header information in the pWaveHeader structure.
|
26 | *
|
27 | * Argument(s) : pulAddress is a pointer to the starting address of the wave file.
|
28 | * pWaveHeader is a pointer to the tWaveHeader data structure to be populated.
|
29 | *
|
30 | * Return(s) : WAVE_OK on success.
|
31 | * WAVE_INVALID_RIFF if RIFF information is not supported.
|
32 | * WAVE_INVALID_CHUNK if chunk size is not supported.
|
33 | * WAVE_INVALID_FORMAT if file format is not supported.
|
34 | *
|
35 | *********************************************************************************************************
|
36 | */
|
37 | BSP_WaveOpen(g_psWaveFiles[g_ucCurrentWaveIdx].pucFilePtr, &g_sWaveHeader);
|
38 |
|
39 | /* (5)
|
40 | *********************************************************************************************************
|
41 | * Description : This will play the file passed in via the psFileObject parameter based on
|
42 | * the format passed in the pWaveHeader structure. The WaveOpen() function
|
43 | * can be used to properly fill the pWaveHeader and psFileObject structures.
|
44 | *
|
45 | * Argument(s) : pWaveHeader is a pointer to the current wave file's header information.
|
46 | *********************************************************************************************************
|
47 | */
|
48 | BSP_WavePlay(&g_sWaveHeader);
|