SDDC_Driver
Loading...
Searching...
No Matches
wavewrite.h
1/*
2 * Copyright (C) 2019 by Hayati Ayguen <h_ayguen@web.de>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#ifndef __WAVEWRITE_H
18#define __WAVEWRITE_H
19
20#include <stdint.h>
21#include <stdio.h>
22#include <time.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28extern int waveHdrStarted;
29
40void waveWriteHeader(unsigned samplerate, unsigned freq, int bitsPerSample, int numChannels, FILE * f);
41
42/* waveWriteFrames() writes (numFrames * numChannels) samples
43 * waveWriteSamples()
44 * both return 0, when no errors occured
45 */
46int waveWriteFrames(FILE* f, void * vpData, size_t numFrames, int needCleanData);
47int waveWriteSamples(FILE* f, void * vpData, size_t numSamples, int needCleanData); /* returns 0, when no errors occured */
48void waveSetStartTime(time_t t, double fraction);
49int waveFinalizeHeader(FILE * f); /* returns 0, when no errors occured */
50
51#ifdef __cplusplus
52}
53#endif
54
55#endif /*__WAVEWRITE_H*/