forked from adafruit/circuitpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWaveFile.h
More file actions
41 lines (34 loc) · 1.19 KB
/
WaveFile.h
File metadata and controls
41 lines (34 loc) · 1.19 KB
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
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2018 Scott Shawcroft
//
// SPDX-License-Identifier: MIT
#pragma once
#include "extmod/vfs_fat.h"
#include "py/obj.h"
#include "shared-module/audiocore/__init__.h"
typedef struct {
audiosample_base_t base;
uint8_t *buffer;
uint32_t buffer_length;
uint8_t *second_buffer;
uint32_t second_buffer_length;
uint32_t file_length; // In bytes
uint16_t data_start; // Where the data values start
uint16_t buffer_index;
uint32_t bytes_remaining;
uint32_t len;
pyb_file_obj_t *file;
uint32_t read_count;
uint32_t left_read_count;
uint32_t right_read_count;
} audioio_wavefile_obj_t;
// These are not available from Python because it may be called in an interrupt.
void audioio_wavefile_reset_buffer(audioio_wavefile_obj_t *self,
bool single_channel_output,
uint8_t channel);
audioio_get_buffer_result_t audioio_wavefile_get_buffer(audioio_wavefile_obj_t *self,
bool single_channel_output,
uint8_t channel,
uint8_t **buffer,
uint32_t *buffer_length); // length in bytes