Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations
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
 Specification of a sound source. More...
 
struct  DeviceSpecs
 Specification of a sound device. More...
 

Macros

#define AUD_FORMAT_SIZE(format)   (format & 0x0F)
 The size of a format in bytes.
 
#define AUD_DEVICE_SAMPLE_SIZE(specs)   (specs.channels * (specs.format & 0x0F))
 The size of a sample in the specified device format in bytes.
 
#define AUD_SAMPLE_SIZE(specs)   (specs.channels * sizeof(sample_t))
 The size of a sample in the specified format in bytes.
 
#define AUD_COMPARE_SPECS(s1, s2)   ((s1.rate == s2.rate) && (s1.channels == s2.channels))
 Compares two audio data specifications.
 
#define AUD_CHANNEL_BIT(channel)   (0x01 << 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...
 
enum  DefaultSampleRate {
  RATE_INVALID = 0 , RATE_8000 = 8000 , RATE_16000 = 16000 , RATE_11025 = 11025 ,
  RATE_22050 = 22050 , RATE_32000 = 32000 , RATE_44100 = 44100 , RATE_48000 = 48000 ,
  RATE_88200 = 88200 , RATE_96000 = 96000 , RATE_192000 = 192000
}
 The sample rate tells how many samples are played back within one second. More...
 

Detailed Description

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

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.

◆ DefaultSampleRate

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

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

Enumerator
RATE_8000 

Invalid sample rate.

RATE_16000 

8000 Hz.

RATE_11025 

16000 Hz.

RATE_22050 

11025 Hz.

RATE_32000 

22050 Hz.

RATE_44100 

32000 Hz.

RATE_48000 

44100 Hz.

RATE_88200 

48000 Hz.

RATE_96000 

88200 Hz.

RATE_192000 

96000 Hz.

◆ 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.