N64FlashcartMenu
Loading...
Searching...
No Matches
Enumerations | Functions
mp3_player.h File Reference

MP3 Player. More...

Go to the source code of this file.

Enumerations

enum  mp3player_err_t {
  MP3PLAYER_OK , MP3PLAYER_ERR_OUT_OF_MEM , MP3PLAYER_ERR_IO , MP3PLAYER_ERR_NO_FILE ,
  MP3PLAYER_ERR_INVALID_FILE
}
 MP3 file error enumeration. More...
 

Functions

void mp3player_mixer_init (void)
 Initialize the MP3 player mixer.
 
mp3player_err_t mp3player_init (void)
 Initialize the MP3 player.
 
void mp3player_deinit (void)
 Deinitialize the MP3 player.
 
mp3player_err_t mp3player_load (char *path)
 Load an MP3 file.
 
void mp3player_unload (void)
 Unload the current MP3 file.
 
mp3player_err_t mp3player_process (void)
 Process the MP3 player.
 
bool mp3player_is_playing (void)
 Check if the MP3 player is playing.
 
bool mp3player_is_finished (void)
 Check if the MP3 player has finished playing.
 
mp3player_err_t mp3player_play (void)
 Start playback of the MP3 file.
 
void mp3player_stop (void)
 Stop playback of the MP3 file.
 
mp3player_err_t mp3player_toggle (void)
 Toggle playback of the MP3 file.
 
void mp3player_mute (bool mute)
 Mute or unmute the MP3 player.
 
mp3player_err_t mp3player_seek (int seconds)
 Seek to a specific position in the MP3 file.
 
float mp3player_get_duration (void)
 Get the duration of the MP3 file.
 
float mp3player_get_bitrate (void)
 Get the bitrate of the MP3 file.
 
int mp3player_get_samplerate (void)
 Get the sample rate of the MP3 file.
 
float mp3player_get_progress (void)
 Get the current playback progress.
 

Detailed Description

MP3 Player.

Enumeration Type Documentation

◆ mp3player_err_t

MP3 file error enumeration.

Enumeration for different types of errors that can occur in the MP3 player.

Enumerator
MP3PLAYER_OK 

No error

MP3PLAYER_ERR_OUT_OF_MEM 

Out of memory error

MP3PLAYER_ERR_IO 

Input/Output error

MP3PLAYER_ERR_NO_FILE 

No file found error

MP3PLAYER_ERR_INVALID_FILE 

Invalid file error

Function Documentation

◆ mp3player_mixer_init()

void mp3player_mixer_init ( void  )

Initialize the MP3 player mixer.

This function initializes the mixer for the MP3 player.

◆ mp3player_init()

mp3player_err_t mp3player_init ( void  )

Initialize the MP3 player.

This function initializes the MP3 player and prepares it for playback.

Returns
mp3player_err_t Error code indicating the result of the initialization.

◆ mp3player_deinit()

void mp3player_deinit ( void  )

Deinitialize the MP3 player.

This function deinitializes the MP3 player and releases any resources.

◆ mp3player_load()

mp3player_err_t mp3player_load ( char *  path)

Load an MP3 file.

This function loads an MP3 file from the specified path.

Parameters
pathPath to the MP3 file.
Returns
mp3player_err_t Error code indicating the result of the load operation.

◆ mp3player_unload()

void mp3player_unload ( void  )

Unload the current MP3 file.

This function unloads the currently loaded MP3 file.

◆ mp3player_process()

mp3player_err_t mp3player_process ( void  )

Process the MP3 player.

This function processes the MP3 player, handling playback and other operations.

Returns
mp3player_err_t Error code indicating the result of the process operation.

◆ mp3player_is_playing()

bool mp3player_is_playing ( void  )

Check if the MP3 player is playing.

This function checks if the MP3 player is currently playing.

Returns
true if the MP3 player is playing, false otherwise.

◆ mp3player_is_finished()

bool mp3player_is_finished ( void  )

Check if the MP3 player has finished playing.

This function checks if the MP3 player has finished playing the current file.

Returns
true if the MP3 player has finished playing, false otherwise.

◆ mp3player_play()

mp3player_err_t mp3player_play ( void  )

Start playback of the MP3 file.

This function starts playback of the currently loaded MP3 file.

Returns
mp3player_err_t Error code indicating the result of the play operation.

◆ mp3player_stop()

void mp3player_stop ( void  )

Stop playback of the MP3 file.

This function stops playback of the currently loaded MP3 file.

◆ mp3player_toggle()

mp3player_err_t mp3player_toggle ( void  )

Toggle playback of the MP3 file.

This function toggles playback of the currently loaded MP3 file.

Returns
mp3player_err_t Error code indicating the result of the toggle operation.

◆ mp3player_mute()

void mp3player_mute ( bool  mute)

Mute or unmute the MP3 player.

This function mutes or unmutes the MP3 player.

Parameters
mutetrue to mute, false to unmute.

◆ mp3player_seek()

mp3player_err_t mp3player_seek ( int  seconds)

Seek to a specific position in the MP3 file.

This function seeks to a specific position in the currently loaded MP3 file.

Parameters
secondsNumber of seconds to seek.
Returns
mp3player_err_t Error code indicating the result of the seek operation.

◆ mp3player_get_duration()

float mp3player_get_duration ( void  )

Get the duration of the MP3 file.

This function gets the duration of the currently loaded MP3 file.

Returns
float Duration of the MP3 file in seconds.

◆ mp3player_get_bitrate()

float mp3player_get_bitrate ( void  )

Get the bitrate of the MP3 file.

This function gets the bitrate of the currently loaded MP3 file.

Returns
float Bitrate of the MP3 file in kbps.

◆ mp3player_get_samplerate()

int mp3player_get_samplerate ( void  )

Get the sample rate of the MP3 file.

This function gets the sample rate of the currently loaded MP3 file.

Returns
int Sample rate of the MP3 file in Hz.

◆ mp3player_get_progress()

float mp3player_get_progress ( void  )

Get the current playback progress.

This function gets the current playback progress of the MP3 file.

Returns
float Current playback progress as a percentage (0.0 to 100.0).