Open Reality Reference Guide
fbaudiofmt.h File Reference

Audio formats definition. More...

#include <kaydaradef.h>
#include <fbsdk/fbtypes.h>

Go to the source code of this file.

Macros

#define FBSDK_DLL   K_DLLIMPORT
 Be sure that FBSDK_DLL is defined only once... More...
 

Typedefs

typedef int FBAudioFmt
 

Enumerations

enum  FBAudioChannelMode {
  kFBAudioChannelModeMono ,
  kFBAudioChannelModeStereo ,
  kFBAudioChannelMode_4 ,
  kFBAudioChannelMode_8
}
 Enum FBAudioChannelMode. More...
 
enum  FBAudioBitDepthMode {
  kFBAudioBitDepthMode_8 ,
  kFBAudioBitDepthMode_16 ,
  kFBAudioBitDepthMode_24 ,
  kFBAudioBitDepthMode_FP
}
 Enum FBAudioBitDepthMode. More...
 
enum  FBAudioRateMode {
  kFBAudioRateMode_8000 ,
  kFBRAudioateMode_11025 ,
  kFBAudioRateMode_12000 ,
  kFBAudioRateMode_12500 ,
  kFBAudioRateMode_16000 ,
  kFBAudioRateMode_22050 ,
  kFBAudioRateMode_24000 ,
  kFBAudioRateMode_25000 ,
  kFBAudioRateMode_32000 ,
  kFBAudioRateMode_44100 ,
  kFBAudioRateMode_48000 ,
  kFBAudioRateMode_50000 ,
  kFBAudioRateMode_64000 ,
  kFBAudioRateMode_88200 ,
  kFBAudioRateMode_96000 ,
  kFBAudioRateMode_100000
}
 Enum FBAudioRateMode. More...
 

Functions

K_DLLIMPORT FBAudioFmt FBAudioFmt_GetDefaultFormat ()
 Get default audio format. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_AppendFormat (FBAudioFmt pFormat, int pChannels, int pBits, int pRate)
 Append the rendering audio format using the specified settings. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_AppendFormat (FBAudioFmt pFormat, const FBAudioFmt pSrcFormat)
 Append the rendering audio format with another audio format. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_RemoveFormat (FBAudioFmt pFormat, int pChannels, int pBits, int pRate)
 Remove channels, bit depth, or rate from the specified audio format object. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_RemoveFormat (FBAudioFmt pFormat, const FBAudioFmt pSrcFormat)
 Remove audio format from another audio format object. More...
 
K_DLLIMPORT int FBAudioFmt_GetChannelValue (FBAudioFmt pFormat)
 Get the channel value of the Audio format object. More...
 
K_DLLIMPORT int FBAudioFmt_GetBitsValue (FBAudioFmt pFormat)
 Get the bit depth value of the Audio format object. More...
 
K_DLLIMPORT int FBAudioFmt_GetBytesValue (FBAudioFmt pFormat)
 Get the bytes value of the Audio format object. More...
 
K_DLLIMPORT int FBAudioFmt_GetRateValue (FBAudioFmt pFormat)
 Get the rate value of the Audio format object. More...
 
K_DLLIMPORT bool FBAudioFmt_TestFormat (const FBAudioFmt pSrcFormat, int pChannels, int pBits, int pRate)
 Test if the given audio format object contains the channel, bit depth, and rate. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_ConvertChannelMode (FBAudioChannelMode pChannelMode)
 Converts an FBAudioChannelMode enum value to its FBAudioFmt object equivalent. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_ConvertBitDepthMode (FBAudioBitDepthMode pBitDepthMode)
 Converts an FBAudioBitDepthMode enum value to its FBAudioFmt object equivalent. More...
 
K_DLLIMPORT FBAudioFmt FBAudioFmt_ConvertRateMode (FBAudioRateMode pRateMode)
 Converts an FBAudioRateMode enum value to its FBAudioFmt object equivalent. More...
 

Detailed Description

Audio formats definition.

Definition in file fbaudiofmt.h.

Macro Definition Documentation

◆ FBSDK_DLL

#define FBSDK_DLL   K_DLLIMPORT

Be sure that FBSDK_DLL is defined only once...

Definition at line 48 of file fbaudiofmt.h.

Typedef Documentation

◆ FBAudioFmt

A type definition for FBAudioFmt.

Definition at line 56 of file fbaudiofmt.h.

Enumeration Type Documentation

◆ FBAudioBitDepthMode

Enum FBAudioBitDepthMode.

Enumerator
kFBAudioBitDepthMode_8 

8 bits, Wave file render support.

kFBAudioBitDepthMode_16 

16 bits, Wave file render support.

kFBAudioBitDepthMode_24 

24 bits, Wave file render support.

kFBAudioBitDepthMode_FP 

FP type audio, Wave file render not support.

Definition at line 70 of file fbaudiofmt.h.

◆ FBAudioChannelMode

Enum FBAudioChannelMode.

Enumerator
kFBAudioChannelModeMono 

1 channel, Wave file render support.

kFBAudioChannelModeStereo 

2 channels, Wave file render support.

kFBAudioChannelMode_4 

4 channels, Wave file render not support.

kFBAudioChannelMode_8 

8 channels, Wave file render not support.

Definition at line 63 of file fbaudiofmt.h.

◆ FBAudioRateMode

Enum FBAudioRateMode.

Enumerator
kFBAudioRateMode_8000 

8000 hz, Wave file render support.

kFBRAudioateMode_11025 

11025 hz, Wave file render support.

kFBAudioRateMode_12000 

12000 hz, Wave file render support.

kFBAudioRateMode_12500 

12500 hz, Wave file render not support.

kFBAudioRateMode_16000 

16000 hz, Wave file render support.

kFBAudioRateMode_22050 

22050 hz, Wave file render support.

kFBAudioRateMode_24000 

24000 hz, Wave file render support.

kFBAudioRateMode_25000 

25000 hz, Wave file render not support.

kFBAudioRateMode_32000 

32000 hz, Wave file render support.

kFBAudioRateMode_44100 

44100 hz, Wave file render support.

kFBAudioRateMode_48000 

48000 hz, Wave file render support.

kFBAudioRateMode_50000 

50000 hz, Wave file render not support.

kFBAudioRateMode_64000 

64000 hz, Wave file render support.

kFBAudioRateMode_88200 

88200 hz, Wave file render support.

kFBAudioRateMode_96000 

96000 hz, Wave file render support.

kFBAudioRateMode_100000 

100000 hz, Wave file render not support.

Definition at line 77 of file fbaudiofmt.h.

Function Documentation

◆ FBAudioFmt_AppendFormat() [1/2]

K_DLLIMPORT FBAudioFmt FBAudioFmt_AppendFormat ( FBAudioFmt  pFormat,
const FBAudioFmt  pSrcFormat 
)

Append the rendering audio format with another audio format.

Parameters
pFormatAudio format to use.
pSrcFormatAudio format to be appended.
Returns
An audio format object with the specified format.

◆ FBAudioFmt_AppendFormat() [2/2]

K_DLLIMPORT FBAudioFmt FBAudioFmt_AppendFormat ( FBAudioFmt  pFormat,
int  pChannels,
int  pBits,
int  pRate 
)

Append the rendering audio format using the specified settings.

For example, to set audio format to 2 channels, 16 bit, 44100 rate, use the following function: AudioFormat = FBAudioFmt_AppendFormat(0, 2, 16, 44100)

Parameters
pFormatAudio format to use. Set this to 0 if there is no audio format to be appended.
pChannelsNumber of channels. Valid values are 0, 1, 2, 4, 8.
pBitsBit depth. Valid values are 0, 8, 16, 24, 32.
pRateAudio rate. Valid values are 0, 8000, 11025, 12000, 12500, 16000, 22050, 24000, 25000, 32000, 44100, 48000, 50000, 64000, 88200, 96000, 100000.
Returns
An audio format object with the specified format.

Python sample code:

from pyfbsdk import *
def printFormat( AudioFormat ):
print "Audio Render Format: ", AudioFormat
print "Audio Channels: ", FBAudioFmt_GetChannelValue( AudioFormat )
print "Audio Bit Depth: ", FBAudioFmt_GetBitsValue( AudioFormat )
print "Audio Rate: ", FBAudioFmt_GetRateValue( AudioFormat )
print ""
# Given an AudioFormat, modify the rate from the old rate to 48000 while
# keeping the other settings intact
print "Old Format:"
printFormat( AudioFormat )
oldrate = FBAudioFmt_GetRateValue( AudioFormat )
AudioFormat = FBAudioFmt_RemoveFormat(AudioFormat, 0, 0, oldrate)
print "Format after removing Audio Rate:"
printFormat( AudioFormat )
AudioFormat = FBAudioFmt_AppendFormat(AudioFormat, 0, 0, 48000)
print "New Format after modifying Audio Rate to 48000"
printFormat( AudioFormat )
K_DLLIMPORT int FBAudioFmt_GetChannelValue(FBAudioFmt pFormat)
Get the channel value of the Audio format object.
K_DLLIMPORT FBAudioFmt FBAudioFmt_GetDefaultFormat()
Get default audio format.
K_DLLIMPORT FBAudioFmt FBAudioFmt_AppendFormat(FBAudioFmt pFormat, int pChannels, int pBits, int pRate)
Append the rendering audio format using the specified settings.
K_DLLIMPORT int FBAudioFmt_GetRateValue(FBAudioFmt pFormat)
Get the rate value of the Audio format object.
K_DLLIMPORT int FBAudioFmt_GetBitsValue(FBAudioFmt pFormat)
Get the bit depth value of the Audio format object.
K_DLLIMPORT FBAudioFmt FBAudioFmt_RemoveFormat(FBAudioFmt pFormat, int pChannels, int pBits, int pRate)
Remove channels, bit depth, or rate from the specified audio format object.

◆ FBAudioFmt_ConvertBitDepthMode()

K_DLLIMPORT FBAudioFmt FBAudioFmt_ConvertBitDepthMode ( FBAudioBitDepthMode  pBitDepthMode)

Converts an FBAudioBitDepthMode enum value to its FBAudioFmt object equivalent.

Parameters
pBitDepthModeThe bit depth mode enum value.
Returns
The FBAudioFmt object equivalent to the input bit depth mode enum value.

◆ FBAudioFmt_ConvertChannelMode()

K_DLLIMPORT FBAudioFmt FBAudioFmt_ConvertChannelMode ( FBAudioChannelMode  pChannelMode)

Converts an FBAudioChannelMode enum value to its FBAudioFmt object equivalent.

Parameters
pChannelModeThe channel mode enum value.
Returns
The FBAudioFmt object equivalent to the input channel mode enum value.

◆ FBAudioFmt_ConvertRateMode()

K_DLLIMPORT FBAudioFmt FBAudioFmt_ConvertRateMode ( FBAudioRateMode  pRateMode)

Converts an FBAudioRateMode enum value to its FBAudioFmt object equivalent.

Parameters
pRateModeThe rate mode enum value.
Returns
The FBAudioFmt object equivalent to the input rate mode enum value.

◆ FBAudioFmt_GetBitsValue()

K_DLLIMPORT int FBAudioFmt_GetBitsValue ( FBAudioFmt  pFormat)

Get the bit depth value of the Audio format object.

Parameters
pFormatAudio format to use.
Returns
Bit depth value as an integer value.

◆ FBAudioFmt_GetBytesValue()

K_DLLIMPORT int FBAudioFmt_GetBytesValue ( FBAudioFmt  pFormat)

Get the bytes value of the Audio format object.

Parameters
pFormatAudio format to use.
Returns
Bytes value as an integer value.

◆ FBAudioFmt_GetChannelValue()

K_DLLIMPORT int FBAudioFmt_GetChannelValue ( FBAudioFmt  pFormat)

Get the channel value of the Audio format object.

Parameters
pFormatAudio format to use.
Returns
Channel value as an integer value.

◆ FBAudioFmt_GetDefaultFormat()

K_DLLIMPORT FBAudioFmt FBAudioFmt_GetDefaultFormat ( )

Get default audio format.

Returns
An audio format object.

◆ FBAudioFmt_GetRateValue()

K_DLLIMPORT int FBAudioFmt_GetRateValue ( FBAudioFmt  pFormat)

Get the rate value of the Audio format object.

Parameters
pFormatAudio format to use.
Returns
Audio rate value as an integer value.

◆ FBAudioFmt_RemoveFormat() [1/2]

K_DLLIMPORT FBAudioFmt FBAudioFmt_RemoveFormat ( FBAudioFmt  pFormat,
const FBAudioFmt  pSrcFormat 
)

Remove audio format from another audio format object.

Parameters
pFormatAudio format to use.
pSrcFormatAudio format to remove.
Returns
An audio format object without the specified format settings passed in parameter.

◆ FBAudioFmt_RemoveFormat() [2/2]

K_DLLIMPORT FBAudioFmt FBAudioFmt_RemoveFormat ( FBAudioFmt  pFormat,
int  pChannels,
int  pBits,
int  pRate 
)

Remove channels, bit depth, or rate from the specified audio format object.

Please refer to python example in FBAudioFmt_AppendFormat.

Parameters
pFormatAudio format to use.
pChannelsNumber of channels to remove. Set this to 0 if you don't want to remove the channel.
pBitsBit depth to remove. Set this to 0 if you don't want to remove bit depth.
pRateAudio rate to remove. Set this to 0 if you don't want to remove audio rate.
Returns
An audio format object without the specified format settings passed in parameter.

◆ FBAudioFmt_TestFormat()

K_DLLIMPORT bool FBAudioFmt_TestFormat ( const FBAudioFmt  pSrcFormat,
int  pChannels,
int  pBits,
int  pRate 
)

Test if the given audio format object contains the channel, bit depth, and rate.

Parameters
pFormatAudio format to test.
pChannelsNumber of channels to test.
pBitsBit depth to test.
pRateAudio rate to test.
Returns
True if the given audio format object contains the channel, bit depth, and rate.