-
Notifications
You must be signed in to change notification settings - Fork 41
/
mp3_decoder.h
52 lines (43 loc) · 1.55 KB
/
mp3_decoder.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
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
// All rights reserved.
#ifndef _MP3_DECODER_H_
#define _MP3_DECODER_H_
#include "esp_err.h"
#include "audio_element.h"
#include "audio_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MP3_DECODER_TASK_STACK_SIZE (5 * 1024)
#define MP3_DECODER_TASK_CORE (0)
#define MP3_DECODER_TASK_PRIO (5)
#define MP3_DECODER_RINGBUFFER_SIZE (2 * 1024)
#define DEFAULT_MP3_DECODER_CONFIG() { \
.out_rb_size = MP3_DECODER_RINGBUFFER_SIZE, \
.task_stack = MP3_DECODER_TASK_STACK_SIZE, \
.task_core = MP3_DECODER_TASK_CORE, \
.task_prio = MP3_DECODER_TASK_PRIO, \
.stack_in_ext = true, \
}
/**
* @brief Mp3 Decoder configuration
*/
typedef struct {
int out_rb_size; /*!< Size of output ringbuffer */
int task_stack; /*!< Task stack size */
int task_core; /*!< CPU core number (0 or 1) where decoder task in running */
int task_prio; /*!< Task priority (based on freeRTOS priority) */
bool stack_in_ext; /*!< Try to allocate stack in external memory */
} mp3_decoder_cfg_t;
/**
* @brief Create an Audio Element handle to decode incoming MP3 data
*
* @param config The configuration
*
* @return The audio element handle
*/
audio_element_handle_t mp3_decoder_init(mp3_decoder_cfg_t *config);
#ifdef __cplusplus
}
#endif
#endif