10#include <zephyr/bluetooth/audio/bap.h>
13#define LE_AUDIO_ZBUS_EVENT_WAIT_TIME K_MSEC(5)
14#define LE_AUDIO_SDU_SIZE_OCTETS(bitrate) (bitrate / (1000000 / CONFIG_AUDIO_FRAME_DURATION_US) / 8)
16#if CONFIG_SAMPLE_RATE_CONVERTER && CONFIG_AUDIO_SAMPLE_RATE_48000_HZ
17#define BT_AUDIO_CODEC_CAPABILIY_FREQ \
18 BT_AUDIO_CODEC_CAP_FREQ_48KHZ | BT_AUDIO_CODEC_CAP_FREQ_24KHZ | \
19 BT_AUDIO_CODEC_CAP_FREQ_16KHZ
21#elif CONFIG_AUDIO_SAMPLE_RATE_16000_HZ
22#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_CAP_FREQ_16KHZ
24#elif CONFIG_AUDIO_SAMPLE_RATE_24000_HZ
25#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_CAP_FREQ_24KHZ
27#elif CONFIG_AUDIO_SAMPLE_RATE_48000_HZ
28#define BT_AUDIO_CODEC_CAPABILIY_FREQ BT_AUDIO_CODEC_CAP_FREQ_48KHZ
31#error No sample rate supported
34#define BT_BAP_LC3_PRESET_CONFIGURABLE(_loc, _stream_context, _bitrate) \
35 BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG(CONFIG_BT_AUDIO_PREF_SAMPLE_RATE_VALUE, \
36 BT_AUDIO_CODEC_CFG_DURATION_10, _loc, \
37 LE_AUDIO_SDU_SIZE_OCTETS(_bitrate), 1, \
39 BT_AUDIO_CODEC_QOS_UNFRAMED(10000u, LE_AUDIO_SDU_SIZE_OCTETS(_bitrate), \
40 CONFIG_BT_AUDIO_RETRANSMITS, \
41 CONFIG_BT_AUDIO_MAX_TRANSPORT_LATENCY_MS, \
42 CONFIG_BT_AUDIO_PRESENTATION_DELAY_US))
148 uint32_t *frame_blks_per_sdu);
audio_channel
Audio channel assignment values.
Definition audio_defines.h:20
Globally accessible audio related defines.
bool le_audio_ep_qos_configured(struct bt_bap_ep const *const ep)
Check if an endpoint has had the QoS configured. If the endpoint is NULL, it is not in the state,...
int le_audio_bitrate_get(const struct bt_audio_codec_cfg *const codec, uint32_t *bitrate)
Get the bitrate for the codec configuration.
int le_audio_duration_us_get(const struct bt_audio_codec_cfg *codec, int *frame_dur_us)
Decode the audio frame duration in us in the codec configuration.
bool le_audio_ep_state_check(struct bt_bap_ep *ep, enum bt_bap_ep_state state)
Check if an endpoint is in the given state. If the endpoint is NULL, it is not in the given state,...
int le_audio_frame_blocks_per_sdu_get(const struct bt_audio_codec_cfg *codec, uint32_t *frame_blks_per_sdu)
Decode the number of frame blocks per SDU in the codec configuration.
int le_audio_freq_hz_get(const struct bt_audio_codec_cfg *codec, int *freq_hz)
Decode the audio sampling frequency in the codec configuration.
bool le_audio_bitrate_check(const struct bt_audio_codec_cfg *codec)
Check that the bitrate is within the supported range.
int le_audio_stream_dir_get(struct bt_bap_stream const *const stream)
Get the direction of the stream provided.
int le_audio_octets_per_frame_get(const struct bt_audio_codec_cfg *codec, uint32_t *octets_per_sdu)
Decode the number of octets per frame in the codec configuration.
bool le_audio_freq_check(const struct bt_audio_codec_cfg *codec)
Check that the sample rate is supported.
void(* le_audio_receive_cb)(const uint8_t *const data, size_t size, bool bad_frame, uint32_t sdu_ref, enum audio_channel channel_index, size_t desired_size)
Callback for receiving Bluetooth LE Audio data.
Definition le_audio.h:54
void le_audio_print_codec(const struct bt_audio_codec_cfg *codec, enum bt_audio_dir dir)
Print the codec configuration.
int le_audio_ep_state_get(struct bt_bap_ep *ep, uint8_t *state)
Get the current state of an endpoint.
uint8_t const *const data
Definition le_audio.h:64
size_t size
Definition le_audio.h:65
uint8_t num_ch
Definition le_audio.h:66
Encoded audio data and information.
Definition le_audio.h:63
uint8_t lvl3
Definition le_audio.h:72
uint8_t lvl2
Definition le_audio.h:71
uint8_t lvl1
Definition le_audio.h:70