nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
lc3_file.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef LC3_FILE_H__
8#define LC3_FILE_H__
9
10#include <stddef.h>
11#include <stdint.h>
12
13#include <zephyr/fs/fs.h>
14#include <zephyr/sys/util.h>
15
17 uint16_t file_id; /* Constant value, 0xCC1C */
18 uint16_t hdr_size; /* Header size, 0x0012 */
19 uint16_t sample_rate; /* Sample frequency / 100 */
20 uint16_t bit_rate; /* Bit rate / 100 (total for all channels) */
21 uint16_t channels; /* Number of channels */
22 uint16_t frame_duration; /* Frame duration in ms * 100 */
23 uint16_t rfu; /* Reserved for future use */
24 uint16_t signal_len_lsb; /* Number of samples in signal, 16 LSB */
25 uint16_t signal_len_msb; /* Number of samples in signal, 16 MSB (>> 16) */
26} __packed;
27
29 struct fs_file_t file_object;
32};
33
44int lc3_file_frame_get(struct lc3_file_ctx *file, uint8_t *buffer, size_t buffer_size);
45
57int lc3_file_open(struct lc3_file_ctx *file, const char *file_name);
58
67int lc3_file_close(struct lc3_file_ctx *file);
68
77int lc3_file_init(void);
78
79#endif /* LC3_FILE_H__ */
int lc3_file_close(struct lc3_file_ctx *file)
Close a LC3 file.
int lc3_file_frame_get(struct lc3_file_ctx *file, uint8_t *buffer, size_t buffer_size)
Get the next LC3 frame from the file.
int lc3_file_init(void)
Initialize the LC3 file module.
int lc3_file_open(struct lc3_file_ctx *file, const char *file_name)
Open a LC3 file for reading.
struct fs_file_t file_object
Definition: lc3_file.h:29
uint32_t number_of_samples
Definition: lc3_file.h:31
struct lc3_file_header lc3_header
Definition: lc3_file.h:30
Definition: lc3_file.h:28
uint16_t signal_len_lsb
Definition: lc3_file.h:24
uint16_t sample_rate
Definition: lc3_file.h:19
uint16_t hdr_size
Definition: lc3_file.h:18
uint16_t frame_duration
Definition: lc3_file.h:22
uint16_t bit_rate
Definition: lc3_file.h:20
uint16_t file_id
Definition: lc3_file.h:17
uint16_t rfu
Definition: lc3_file.h:23
uint16_t channels
Definition: lc3_file.h:21
uint16_t signal_len_msb
Definition: lc3_file.h:25
Definition: lc3_file.h:16