Select one of the symbols to view example projects that use it.
 
Outline
#define __AUDIOPLAYER_APP_H
#include "main.h"
Exported constants
#define MUTE_OFF
#define MUTE_ON
#define PLAY_ACTIVE
#define PAUSE_ACTIVE
#define AUDIO_BUFFER_SIZE
Exported types
AUDIOPLAYER_StateTypdef
BUFFER_StateTypeDef
AUDIOPLAYER_ErrorTypdef
AUDIOPLAYER_ProcessTypdef
WAV_InfoTypedef
AUDIOPLAYER_Init();
AUDIOPLAYER_Play(uint32_t);
AUDIOPLAYER_Stop();
AUDIOPLAYER_Pause();
AUDIOPLAYER_Resume();
AUDIOPLAYER_Mute(uint8_t);
AUDIOPLAYER_GetFileInfo(char *, WAV_InfoTypedef *);
AUDIOPLAYER_SelectFile(char *);
AUDIOPLAYER_GetState();
AUDIOPLAYER_Process();
AUDIOPLAYER_DeInit();
AUDIOPLAYER_GetProgress();
AUDIOPLAYER_SetVolume(uint32_t);
AUDIOPLAYER_GetVolume();
AUDIOPLAYER_NotifyEndOfFile();
AUDIOPLAYER_SetPosition(uint32_t);
Files
loading...
CodeScopeSTM32 Libraries and SamplesMB1063Modules/audioplayer/audioplayer_app.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file audioplayer_app.h * @author MCD Application Team * @brief header of audio player application file ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __AUDIOPLAYER_APP_H #define __AUDIOPLAYER_APP_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "main.h" /* Exported constants --------------------------------------------------------*/ #define MUTE_OFF 0x00 #define MUTE_ON 0x01 #define PLAY_ACTIVE 0x00 #define PAUSE_ACTIVE 0x01 #define AUDIO_BUFFER_SIZE (1024 * 8) 5 defines Exported constants /* Exported types ------------------------------------------------------------*/ typedef enum { AUDIOPLAYER_STOP = 0, AUDIOPLAYER_START, AUDIOPLAYER_PLAY, AUDIOPLAYER_PAUSE, AUDIOPLAYER_EOF, AUDIOPLAYER_ERROR, ...}AUDIOPLAYER_StateTypdef; typedef enum { BUFFER_OFFSET_NONE = 0, BUFFER_OFFSET_HALF, BUFFER_OFFSET_FULL, ...} BUFFER_StateTypeDef; typedef enum { AUDIOPLAYER_ERROR_NONE = 0, AUDIOPLAYER_ERROR_IO, AUDIOPLAYER_ERROR_HW, AUDIOPLAYER_ERROR_MEM, AUDIOPLAYER_ERROR_FORMAT_NOTSUPPORTED, ...}AUDIOPLAYER_ErrorTypdef; typedef struct { uint8_t buffer[AUDIO_BUFFER_SIZE]; uint32_t volume; uint32_t mute; AUDIOPLAYER_StateTypdef state; ...}AUDIOPLAYER_ProcessTypdef ; typedef struct { uint32_t ChunkID; /* 0 */ uint32_t FileSize; /* 4 */ uint32_t FileFormat; /* 8 */ uint32_t SubChunk1ID; /* 12 */ uint32_t SubChunk1Size; /* 16*/ uint16_t AudioFormat; /* 20 */ uint16_t NbrChannels; /* 22 */ uint32_t SampleRate; /* 24 */ uint32_t ByteRate; /* 28 */ uint16_t BlockAlign; /* 32 */ uint16_t BitPerSample; /* 34 */ uint32_t SubChunk2ID; /* 36 */ uint32_t SubChunk2Size; /* 40 */ ...}WAV_InfoTypedef ; Exported types /* Exported macros -----------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Init(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Play(uint32_t frequency); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Stop(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Pause(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Resume(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Mute(uint8_t state); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_GetFileInfo(char* file, WAV_InfoTypedef* info); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_SelectFile(char* file); AUDIOPLAYER_StateTypdef AUDIOPLAYER_GetState(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_Process(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_DeInit(void); uint32_t AUDIOPLAYER_GetProgress (void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_SetVolume(uint32_t volume); uint32_t AUDIOPLAYER_GetVolume(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_NotifyEndOfFile(void); AUDIOPLAYER_ErrorTypdef AUDIOPLAYER_SetPosition(uint32_t position); #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif /*__AUDIOPLAYER_APP_H */