Audaspace 1.10.0
A high level audio library.
Loading...
Searching...
No Matches
Specification.h File Reference

Defines all important macros and basic data structures for stream format descriptions. More...

#include "Audaspace.h"
Include dependency graph for Specification.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Specs
 192000 Hz. More...
struct  DeviceSpecs
 Specification of a sound device. More...

Macros

#define AUD_FORMAT_SIZE(format)
 The size of a format in bytes.
#define AUD_DEVICE_SAMPLE_SIZE(specs)
 The size of a sample in the specified device format in bytes.
#define AUD_SAMPLE_SIZE(specs)
 The size of a sample in the specified format in bytes.
#define AUD_COMPARE_SPECS(s1, s2)
 Compares two audio data specifications.
#define AUD_CHANNEL_BIT(channel)
 Returns the bit for a channel mask.

Typedefs

typedef double SampleRate
 Sample rate type.

Enumerations

enum  SampleFormat {
  FORMAT_INVALID = 0x00 , FORMAT_U8 = 0x01 , FORMAT_S16 = 0x12 , FORMAT_S24 = 0x13 ,
  FORMAT_S32 = 0x14 , FORMAT_FLOAT32 = 0x24 , FORMAT_FLOAT64 = 0x28
}
 The format of a sample. More...
enum  Channels {
  CHANNELS_INVALID = 0 , CHANNELS_MONO = 1 , CHANNELS_STEREO = 2 , CHANNELS_STEREO_LFE = 3 ,
  CHANNELS_SURROUND4 = 4 , CHANNELS_SURROUND5 = 5 , CHANNELS_SURROUND51 = 6 , CHANNELS_SURROUND61 = 7 ,
  CHANNELS_SURROUND71 = 8
}
 The channel count. More...
enum  Channel {
  CHANNEL_FRONT_LEFT = 0 , CHANNEL_FRONT_RIGHT , CHANNEL_FRONT_CENTER , CHANNEL_LFE ,
  CHANNEL_REAR_LEFT , CHANNEL_REAR_RIGHT , CHANNEL_REAR_CENTER , CHANNEL_SIDE_LEFT ,
  CHANNEL_SIDE_RIGHT , CHANNEL_MAX
}
 The channel names.
enum class  ResampleQuality { FASTEST = 0 , LOW , MEDIUM , HIGH }
 Resampling algorithm and quality. More...

Variables

constexpr SampleRate RATE_INVALID = 0
 The sample rate tells how many samples are played back within one second.
constexpr SampleRate RATE_8000 = 8000
 Invalid sample rate.
constexpr SampleRate RATE_16000 = 16000
 8000 Hz.
constexpr SampleRate RATE_11025 = 11025
 16000 Hz.
constexpr SampleRate RATE_22050 = 22050
 11025 Hz.
constexpr SampleRate RATE_32000 = 32000
 22050 Hz.
constexpr SampleRate RATE_44100 = 44100
 32000 Hz.
constexpr SampleRate RATE_48000 = 48000
 44100 Hz.
constexpr SampleRate RATE_88200 = 88200
 48000 Hz.
constexpr SampleRate RATE_96000 = 96000
 88200 Hz.
constexpr SampleRate RATE_192000 = 192000
 96000 Hz.

Detailed Description

Defines all important macros and basic data structures for stream format descriptions.

Macro Definition Documentation

◆ AUD_CHANNEL_BIT

#define AUD_CHANNEL_BIT ( channel)
Value:
(0x01 << channel)

Returns the bit for a channel mask.

◆ AUD_COMPARE_SPECS

#define AUD_COMPARE_SPECS ( s1,
s2 )
Value:
((s1.rate == s2.rate) && (s1.channels == s2.channels))

Compares two audio data specifications.

◆ AUD_DEVICE_SAMPLE_SIZE

#define AUD_DEVICE_SAMPLE_SIZE ( specs)
Value:
(specs.channels * (specs.format & 0x0F))

The size of a sample in the specified device format in bytes.

◆ AUD_FORMAT_SIZE

#define AUD_FORMAT_SIZE ( format)
Value:
(format & 0x0F)

The size of a format in bytes.

◆ AUD_SAMPLE_SIZE

#define AUD_SAMPLE_SIZE ( specs)
Value:
(specs.channels * sizeof(sample_t))
float sample_t
Sample type.(float samples).
Definition Audaspace.h:126

The size of a sample in the specified format in bytes.

Enumeration Type Documentation

◆ Channels

enum Channels

The channel count.

Enumerator
CHANNELS_MONO 

Invalid channel count.

CHANNELS_STEREO 

Mono.

CHANNELS_STEREO_LFE 

Stereo.

CHANNELS_SURROUND4 

Stereo with LFE channel.

CHANNELS_SURROUND5 

4 channel surround sound.

CHANNELS_SURROUND51 

5 channel surround sound.

CHANNELS_SURROUND61 

5.1 surround sound.

CHANNELS_SURROUND71 

6.1 surround sound.

◆ ResampleQuality

enum class ResampleQuality
strong

Resampling algorithm and quality.

Enumerator
LOW 

Linear resample, very fast but lowest quality.

MEDIUM 

JOS resample at low quality preset.

HIGH 

JOS resample at medium quality preset.

JOS resample at high quality preset.

◆ SampleFormat

The format of a sample.

The last 4 bit save the byte count of the format.

Enumerator
FORMAT_U8 

Invalid sample format.

FORMAT_S16 

1 byte unsigned byte.

FORMAT_S24 

2 byte signed integer.

FORMAT_S32 

3 byte signed integer.

FORMAT_FLOAT32 

4 byte signed integer.

FORMAT_FLOAT64 

4 byte float.

Variable Documentation

◆ RATE_INVALID

SampleRate RATE_INVALID = 0
constexpr

The sample rate tells how many samples are played back within one second.

Some exotic formats may use other sample rates than provided here.