-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmp3player.h
More file actions
36 lines (27 loc) · 877 Bytes
/
mp3player.h
File metadata and controls
36 lines (27 loc) · 877 Bytes
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
#ifndef MP3PLAYER_H
#define MP3PLAYER_H
// Initialize the MP3 player system (load AV modules)
// Returns 0 on success, < 0 on error
int mp3Init(void);
// Start playing an MP3 file (spawns decode thread)
// Returns 0 on success, < 0 on error
int mp3Play(const char *filepath);
// Stop current playback
void mp3Stop(void);
// Pause/Resume
void mp3Pause(void);
void mp3Resume(void);
int mp3IsPaused(void);
// State queries
int mp3IsPlaying(void); // 1 if currently playing
int mp3GetPlayTime(void); // elapsed time in seconds
int mp3HasFinished(void); // 1 if song ended naturally
// Volume control (0-100)
void mp3SetVolume(int vol);
int mp3GetVolume(void);
// Seek: skip forward/backward by seconds (approximate)
void mp3SeekForward(int seconds);
void mp3SeekBackward(int seconds);
// Shutdown and release resources
void mp3Shutdown(void);
#endif // MP3PLAYER_H