Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

EAudioFmt.h File Reference

Defines audio formats. More...

#include "KTypes.h"

Defines

#define VorbisQualToFloat(q)   (((q&K_AF_SUBMASK)-K_AF_VORBIS_Q0)/10.f)
 Converts a Vorbis quality from a EAudioFmt value to a float value.
#define VorbisQualToAudioFmt(q)   ((KInt) (q * 10) + K_AF_VORBIS_Q0)
 Converts a Vorbis quality from a float value to a EAudioFmt value.

Enumerations

enum  EAudioFmt {
  K_AF_UNKNOWN = 0, K_AF_WAV = 0x010000, K_AF_AIFF = 0x020000, K_AF_AU = 0x030000,
  K_AF_FLAC = 0x170000, K_AF_CAF = 0x180000, K_AF_VORBIS = 0x510000, K_AF_MPG = 0x520000,
  K_AF_AAC = 0x530000, K_AF_PCM_S8 = 0x0001, K_AF_PCM_16 = 0x0002, K_AF_PCM_24 = 0x0003,
  K_AF_PCM_32 = 0x0004, K_AF_PCM_U8 = 0x0005, K_AF_FLOAT = 0x0006, K_AF_DOUBLE = 0x0007,
  K_AF_ULAW = 0x0010, K_AF_ALAW = 0x0011, K_AF_IMA_ADPCM = 0x0012, K_AF_MS_ADPCM = 0x0013,
  K_AF_VORBIS_Q1N = 0x00FF, K_AF_VORBIS_Q0 = 0x0100, K_AF_VORBIS_Q1 = 0x0101, K_AF_VORBIS_Q2 = 0x0102,
  K_AF_VORBIS_Q3 = 0x0103, K_AF_VORBIS_Q4 = 0x0104, K_AF_VORBIS_Q5 = 0x0105, K_AF_VORBIS_Q6 = 0x0106,
  K_AF_VORBIS_Q7 = 0x0107, K_AF_VORBIS_Q8 = 0x0108, K_AF_VORBIS_Q9 = 0x0109, K_AF_VORBIS_Q10 = 0x010A,
  K_AF_MASK_COMPR = 0xF000, K_AF_CBR = 0x1000, K_AF_ABR = 0x2000, K_AF_VBR = 0x3000,
  K_AF_MPEG_VERS = 0x00f0, K_AF_MPG_1_0 = 0x0010, K_AF_MPG_2_0 = 0x0020, K_AF_MPG_2_5 = 0x0030,
  K_AF_MPEG_LAYER = 0x000f, K_ENDIAN_FILE = 0x00000000, K_ENDIAN_LITTLE = 0x10000000, K_ENDIAN_BIG = 0x20000000,
  K_ENDIAN_CPU = 0x30000000, K_AF_SUBMASK = 0x0000FFFF, K_AF_TYPEMASK = 0x0FFF0000
}
 Audio formats. More...

Functions

KTL_API EAudioFmt EAudioFmt_getMajorFmtFromString (KCString sFmtName)
 Gets the audio format corresponding to the given string.
KTL_API EAudioFmt EAudioFmt_getSubFmtFromString (KCString sSubFmtName)
 Gets the sub audio format corresponding to the given string.
KTL_API KString EAudioFmt_getMajorFmtName (const EAudioFmt fmt)
 Gets an audio format string corresponding to the given code.
KTL_API KString EAudioFmt_getSubFmtName (const EAudioFmt fmt)
 Gets the sub audio format corresponding to the given code.
KTL_API KString EAudioFmt_getEndianFmtName (const EAudioFmt fmt)
 Obtains the mode Big Endian or Little Endian of the given audio format.
KTL_API KInt EAudioFmt_getNumberBits (const EAudioFmt fmt)
 Obtains the bits number used by the given audio format.
KTL_API KString EAudioFmt_getSmallName (const EAudioFmt fmt)
 Obtains the mnemonic of the given audio format.
KTL_API KBool EAudioFmt_isSndFileFmt (const EAudioFmt fmt)
 Allows to know if the given format is an audio format.
KTL_API EAudioFmt k_getAudioType (KString path)
 Obtains the audio format of the given file path.
KTL_API KString EAudioFmt_getExt (const EAudioFmt aFmt)
 Obtains the extension of the given audio format.
KTL_API KString EAudioFmt_mpegSubFmt (const EAudioFmt aFmt)
 Obtains the sub-format of given MPEG format.


Detailed Description

Defines audio formats.

EAudioFmt is based on libsndfile for better compatilities. See http://www.mega-nerd.com/libsndfile/ for more information on libsndfile.

Version:
KToolLib-1.0
Author:
Fabien Gallot
Date:
30/04/2008
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Define Documentation

#define VorbisQualToAudioFmt  )     ((KInt) (q * 10) + K_AF_VORBIS_Q0)
 

Converts a Vorbis quality from a float value to a EAudioFmt value.

Parameters:
q a float value
Returns:
a EAudioFmt value

#define VorbisQualToFloat  )     (((q&K_AF_SUBMASK)-K_AF_VORBIS_Q0)/10.f)
 

Converts a Vorbis quality from a EAudioFmt value to a float value.

Parameters:
q a EAudioFmt value
Returns:
a float value


Enumeration Type Documentation

enum EAudioFmt
 

Audio formats.

Enumeration values:
K_AF_UNKNOWN  Unknown format.
K_AF_WAV  Microsoft WAV format.
K_AF_AIFF  Apple/SGI AIFF format.
K_AF_AU  Sun/NeXT AU format.
K_AF_FLAC  FLAC lossless file format.
K_AF_CAF  Core Audio File format .
K_AF_VORBIS  Vorbis lossy audio codec.
K_AF_MPG  Mpeg Formats.
K_AF_AAC  Advanced Audio Coding (AAC - ISO/CEI 13818-7).
K_AF_PCM_S8  Signed 8 bit data. This is a sub-format.
K_AF_PCM_16  Signed 16 bit data .This is a sub-format.
K_AF_PCM_24  Signed 24 bit data. This is a sub-format.
K_AF_PCM_32  Signed 32 bit data. This is a sub-format.
K_AF_PCM_U8  Unsigned 8 bit data. This is a sub-format.
K_AF_FLOAT  32 bit float data. This is a sub-format
K_AF_DOUBLE  64 bit float data. This is a sub-format
K_AF_ULAW  U-Law encoded. This is a sub-format.
K_AF_ALAW  A-Law encoded. This is a sub-format.
K_AF_IMA_ADPCM  IMA ADPCM. This is a sub-format.
K_AF_MS_ADPCM  Microsoft ADPCM. This is a sub-format.
K_AF_VORBIS_Q1N  Vorbis quality -1. This is a mask and not an audio format and only used with K_AF_VORBIS format.
K_AF_VORBIS_Q0  Vorbis quality 0. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q1  Vorbis quality 1. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q2  Vorbis quality 2. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q3  Vorbis quality 3. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q4  Vorbis quality 4. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q5  Vorbis quality 5. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q6  Vorbis quality 6. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q7  Vorbis quality 7. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q8  Vorbis quality 8. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q9  Vorbis quality 9. This is a sub-format only used with K_AF_VORBIS format.
K_AF_VORBIS_Q10  Vorbis quality 10. This is a sub-format only used with K_AF_VORBIS format.
K_AF_MASK_COMPR  Mpeg Compression Mode Mask. This is a mask and not an audio format and only used with K_AF_MPG and K_AF_AAC formats.
K_AF_CBR  Constant Bitrate (CBR) Compression. This is a sub-format only used with K_AF_MPG and K_AF_AAC formats.
K_AF_ABR  Average Bitrate (ABR) Compression. This is a sub-format only used with K_AF_MPG and K_AF_AAC formats.
K_AF_VBR  Variable Bitrate (VBR) Compression. This is a sub-format only used with K_AF_MPG and K_AF_AAC formats.
K_AF_MPEG_VERS  Mpeg Version Mask. This is a mask and not an audio format and only used with K_AF_MPG format.
K_AF_MPG_1_0  Mpeg Version 1.0. This is a sub-format only used with K_AF_MPG format.
K_AF_MPG_2_0  Mpeg Version 2.0. This is a sub-format only used with K_AF_MPG format.
K_AF_MPG_2_5  Mpeg Version 3.0. This is a sub-format only used with K_AF_MPG format.
K_AF_MPEG_LAYER  Mpeg Layer Mask. This is a mask and not an audio format and only used with K_AF_MPG and K_AF_AAC formats.
K_ENDIAN_FILE  Default file endian-ness.
K_ENDIAN_LITTLE  Force little endian-ness.
K_ENDIAN_BIG  Force big endian-ness.
K_ENDIAN_CPU  Force CPU endian-ness.
K_AF_SUBMASK  Sub Format Mask. This is a mask and not an audio format.
K_AF_TYPEMASK  Major Format Mask. This is a mask and not an audio format.


Function Documentation

KTL_API KString EAudioFmt_getEndianFmtName const EAudioFmt  fmt  ) 
 

Obtains the mode Big Endian or Little Endian of the given audio format.

Parameters:
fmt the EAudioFmt code
Returns:
the string that specifies the mode of the audio format

KTL_API KString EAudioFmt_getExt const EAudioFmt  aFmt  ) 
 

Obtains the extension of the given audio format.

Parameters:
aFmt the EAudioFmt code
Returns:
the string that specifies the extension of the format if successful otherwise knull

KTL_API EAudioFmt EAudioFmt_getMajorFmtFromString KCString  sFmtName  ) 
 

Gets the audio format corresponding to the given string.

Parameters:
sFmtName the string corresponding to an audio format
Returns:
the corresponding EAudioFmt code

KTL_API KString EAudioFmt_getMajorFmtName const EAudioFmt  fmt  ) 
 

Gets an audio format string corresponding to the given code.

Parameters:
fmt the EAudioFmt code corresponding to an audio format
Returns:
the string corresponding to the EAudioFmt code

KTL_API KInt EAudioFmt_getNumberBits const EAudioFmt  fmt  ) 
 

Obtains the bits number used by the given audio format.

Parameters:
fmt the EAudioFmt code
Returns:
an integral number that specifies the bits number of the audio format

KTL_API KString EAudioFmt_getSmallName const EAudioFmt  fmt  ) 
 

Obtains the mnemonic of the given audio format.

Parameters:
fmt the EAudioFmt code
Returns:
the string that specifies the mnemonic of the audio format if successful otherwise knull

KTL_API EAudioFmt EAudioFmt_getSubFmtFromString KCString  sSubFmtName  ) 
 

Gets the sub audio format corresponding to the given string.

Parameters:
sSubFmtName the string corresponding to the sub audio format
Returns:
the corresponding EAudioFmt code

KTL_API KString EAudioFmt_getSubFmtName const EAudioFmt  fmt  ) 
 

Gets the sub audio format corresponding to the given code.

Parameters:
fmt the EAudioFmt code corresponding to a sub audio format
Returns:
the string corresponding to the EAudioFmt code

KTL_API KBool EAudioFmt_isSndFileFmt const EAudioFmt  fmt  ) 
 

Allows to know if the given format is an audio format.

Parameters:
fmt the EAudioFmt code
Returns:
ktrue if the given format is an audio format otherwise kfalse

KTL_API KString EAudioFmt_mpegSubFmt const EAudioFmt  aFmt  ) 
 

Obtains the sub-format of given MPEG format.

Parameters:
aFmt the EAudioFmt code
Returns:
the string corresponding to the MPEG EAudioFmt code

KTL_API EAudioFmt k_getAudioType KString  path  ) 
 

Obtains the audio format of the given file path.

Parameters:
path the string that specifies the file path
Returns:
an EAudioFmt code


Generated on Tue Mar 9 10:49:29 2010 for iKlax Tools Library (KToolLib) by doxygen 1.3.8