summaryrefslogtreecommitdiffstats
path: root/parecord/audio_types.h
blob: d151dce1093feaaeb65e3bbf0163d617843d31b9 (plain)
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
#ifndef PAR_AUDIOTYPES_H
#define PAR_AUDIOTYPES_H

#include <stdint.h>
#include <sys/types.h>
#include <pulse/sample.h>

#include "wav_header.h"

enum audio_types {
	AUDIO_TYPE_WAVE,
	AUDIO_TYPE_NONE = -1
};

struct audio_types_info {
	const char *name;
	off_t rsv_bytes;
};

struct audio_formats_info {
	const char *name;
	pa_sample_format_t pa_format;
};

struct wav_header *init_wav_header(struct wav_header *header,
	uint32_t size, uint16_t audioFormat, uint16_t numChannels,
	uint32_t sampleRate, uint32_t bitsPerSample);
int checkAudioType(char *source);
off_t getOffset(int format);
pa_sample_format_t checkAudioFormat(char *source);

#endif /* AT_AUDIOTYPES_H */