Forum: Mikrocontroller und Digitale Elektronik wav abspielen


von Smoky (Gast)


Lesenswert?

Hallo zusammen!

Ich bin hier grad am verzweifeln.
Die Situation ist folgende:

Auf einer SDKarte befinden sich waves, welche ich mit dem Player aus
einem Beispiel von µC/OS-III abspielen möchte.

In diesem Beispiel liegen die 5 Files im internen Speicher.

Die Frage ist jetzt, wie schaffe ich es ihm an Punkt (1) mitzuteilen,
wo sich die Titel auf der Karte befinden.
Der Zugriff geschieht mittels FATFS.

Es wäre nett, wenn mir jemand den Übergang zwischen f_read/f_open (also 
dem FATFS-Part)und der besagte Stelle im Code nennen könnte.

Vielen Dank schon mal!


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);

von Smoky (Gast)


Lesenswert?

Ich denke ich hab grad was gefunden... man tüfftelt immer stundenlang 
rum,
stellt das Anliegen in einem Forum und kurze Zeit später kommt man 
selbst
dahinter.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.