Skip to content

Commit

Permalink
examples/audio_player_objif: Support to play without playlist
Browse files Browse the repository at this point in the history
Change so that it can be played without using a playlist.
  • Loading branch information
SPRESENSE committed Oct 13, 2022
1 parent bc31906 commit 6458d59
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions examples/audio_player_objif/audio_player_objif_main.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ using namespace MemMgrLite;
#define PLAYBACK_FILE_NAME "Sound.mp3"
#define PLAYBACK_CH_NUM AS_CHANNEL_STEREO
#define PLAYBACK_BIT_LEN AS_BITLENGTH_16
#define PLAYBACK_SAMPLING_RATE AS_SAMPLINGRATE_48000
#define PLAYBACK_SAMPLING_RATE AS_SAMPLINGRATE_48000
#define PLAYBACK_CODEC_TYPE AS_CODECTYPE_MP3

/*------------------------------
Expand Down Expand Up @@ -235,8 +235,6 @@ struct player_info_s
struct player_file_info_s file;
#ifdef CONFIG_AUDIOUTILS_PLAYLIST
Playlist *playlist_ins = NULL;
#else
#error "AUDIOUTILS_PLAYLIST is not enable"
#endif
};

Expand Down Expand Up @@ -411,6 +409,8 @@ static bool app_get_next_track(Track* track)
track->bit_length = PLAYBACK_BIT_LEN;
track->sampling_rate = PLAYBACK_SAMPLING_RATE;
track->codec_type = PLAYBACK_CODEC_TYPE;

ret = true;
#endif /* #ifdef CONFIG_AUDIOUTILS_PLAYLIST */

return ret;
Expand Down Expand Up @@ -1429,13 +1429,15 @@ extern "C" int main(int argc, FAR char *argv[])

app_freq_release();

#ifdef CONFIG_AUDIOUTILS_PLAYLIST
/* Close playlist. */

if (!app_close_playlist())
{
printf("Error: app_close_playlist() failure.\n");
return 1;
}
#endif

if (!app_close_contents_dir())
{
Expand Down

0 comments on commit 6458d59

Please sign in to comment.