HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
AudioFormatInfo.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
4
11#define HEPHAUDIO_INTERNAL_FORMAT(chLayout, sampleRate) HephAudio::AudioFormatInfo(HEPHAUDIO_FORMAT_TAG_HEPHAUDIO_INTERNAL, sizeof(heph_audio_sample_t) * 8, chLayout, sampleRate, HEPH_SYSTEM_ENDIAN)
12
13namespace HephAudio
14{
20 {
25 uint16_t formatTag;
26
31 uint16_t bitsPerSample;
32
35
40 uint32_t sampleRate;
41
46 uint32_t bitRate;
47
52 Heph::Endian endian;
53
56
65 AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate);
66
76 AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, uint32_t bitRate);
77
87 AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, Heph::Endian endian);
88
99 AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, uint32_t bitRate, Heph::Endian endian);
100
101 bool operator==(const AudioFormatInfo& rhs) const;
102 bool operator!=(const AudioFormatInfo& rhs) const;
103
108 uint16_t FrameSize() const;
109
114 uint32_t ByteRate() const;
115
120 static uint32_t CalculateBitrate(const AudioFormatInfo& formatInfo);
121 };
122}
#define HEPH_API
Definition HephShared.h:132
stores information about the channel layout.
Definition AudioChannelLayout.h:136
stores the properties of the audio signals
Definition AudioFormatInfo.h:20
Heph::Endian endian
Definition AudioFormatInfo.h:52
AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, uint32_t bitRate, Heph::Endian endian)
uint32_t bitRate
Definition AudioFormatInfo.h:46
uint16_t bitsPerSample
Definition AudioFormatInfo.h:31
uint32_t ByteRate() const
uint16_t formatTag
Definition AudioFormatInfo.h:25
uint16_t FrameSize() const
AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, uint32_t bitRate)
AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate, Heph::Endian endian)
AudioFormatInfo(uint16_t formatTag, uint16_t bitsPerSample, AudioChannelLayout chLayout, uint32_t sampleRate)
AudioChannelLayout channelLayout
stores information about the channel layout.
Definition AudioFormatInfo.h:34
static uint32_t CalculateBitrate(const AudioFormatInfo &formatInfo)
uint32_t sampleRate
Definition AudioFormatInfo.h:40