WAV player.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "compiler.h"
#include "com_task.h"
#include "audio_interface.h"
#include "file.h"
#include "audio_mixer.h"
#include "conf_audio_player.h"
#include "wavdecode.h"
Macros | |
#define | IN_BUFFER_SIZE 512 |
Functions | |
bool | play_wav (const char *filename, bool verbose) |
This is the function called by ushell_task() to perform all the WAV decoding. More... | |
bool | wav_file_get_data (struct wav_info_t *wav_info) |
Callback from WAV decoder. More... | |
uint32_t | wav_get_file_duration (void) |
Variables | |
uint32_t | g_player_currentTime_ms |
uint32_t | g_player_duration |
Ai_player_flag_t | g_player_flag |
static uint32_t | wav_file_duration_s = 0 |
#define IN_BUFFER_SIZE 512 |
Size of the input buffer in bytes. This buffer is used to read the data from the file itself and will be passed directly to the WAV decoding function.
Referenced by play_wav(), and wav_file_get_data().
This is the function called by ushell_task() to perform all the WAV decoding.
References audio_mixer_close, audio_mixer_create_buffers, audio_mixer_dacs_flush, audio_mixer_dacs_is_volume_muted, audio_mixer_dacs_output, audio_mixer_dacs_setup, audio_mixer_get_buffer, audio_mixer_mute_audio, wav_info_t::bits_per_sample, wav_info_t::buffer, com_task(), fat_check_mount_select_open(), file_close(), file_open(), file_seek(), FOPEN_MODE_R, FS_NAV_ID_AUDIO, FS_SEEK_CUR_FW, FS_SEEK_CUR_RE, g_player_currentTime_ms, g_player_duration, wav_info_t::in_buffer_left, IN_BUFFER_SIZE, Min, nav_select(), wav_info_t::nChannels, OUTPUT_BUFFER_SIZE, wav_info_t::pcm_samples, wav_info_t::pcm_samples_length, PLAYER_FLAG_FFW, PLAYER_FLAG_FRW, PLAYER_FLAG_NORMAL, PLAYER_FLAG_PAUSE, PLAYER_FLAG_PLAY, PLAYER_FLAG_STOP, wav_info_t::sampling_rate, Ai_player_flag_t::status, Ai_player_flag_t::status_fast, wav_decode(), wav_decode_end(), wav_file_duration_s, wav_get_duration_s(), and wav_header_decode().
Referenced by codec_wav_task().
uint32_t wav_get_file_duration | ( | void | ) |
References wav_file_duration_s.
uint32_t g_player_currentTime_ms |
Referenced by play_wav().
uint32_t g_player_duration |
Referenced by play_wav().
Ai_player_flag_t g_player_flag |
|
static |
Referenced by play_wav(), and wav_get_file_duration().