-
Notifications
You must be signed in to change notification settings - Fork 13
Multi Channel Audio 2 1 up to 7 1
By default you don't have to setup anything in FPL, if your audio device supports multiple channels you can get the fplAudioChannelLayout and the number of channels from the fplAudioFormat.
settings;
(&settings);
if ((, &settings)) {
// ... your code here
}By default, FPL uses the native audio channel layout for your default sound device, but you can overwrite it by setting the fplAudioChannelLayout in the fplAudioSettings structure:
settings;
(&settings);
&audioSettings = settings.;
// Forcing to use a 5.1 audio channel layout with 6 channels
audioSettings.layout = ;
// Or you can set the number of channels to 6 for 5.1 as well
audioSettings.channels = 6;
if ((, &settings)) {
// ... your code here
}Note: You have to call
fplGetAudioChannelMap() to get the actual audio channel mapping table, which maps each audio channel to a
A channel map is a table of channel indices to a fplAudioChannelType.
If you have a fplAudioChannelLayout_Stereo or even fplAudioChannelLayout_Mono, you can simply use the default indices (0|1) or just zero for mono.
As soon as you have more than two channels, you have to get the fplAudioChannelMap from the current audio backend and map your source channel indices. You can get the current fplAudioChannelMap by calling fplGetAudioChannelMap().
This must be called, after the audio system has been initialized, either after fplPlatformInit() or after fplAudioInit().
channelMap = ;
if ((&channelMap)) {
// Do your own channel mapping from your source samples
}- Assertion & Debug
- Atomic operations
- Audio functions
- Clipboard functions
- Console functions
- Constants
- Display/Monitor functions
- Dynamic library loading
- Error Handling
- Files/IO functions
- Function macros
- Hardware Infos
- Input types and functions
- Localization functions
- Logging
- Memory Macros
- Memory functions
- Operating system Infos
- Path functions
- Platform functions
- Session Infos
- Settings & Configurations
- Storage class identifiers
- String functions
- Threading and synchronizations routines
- Timing functions
- Video functions
- Window events
- Window functions
- fplARMCPUCapabilities
- fplAudioChannelMap
- fplAudioDeviceID
- fplAudioDeviceInfo
- fplAudioFormat
- fplAudioSettings
- fplColor32
- fplConditionVariable
- fplConsoleSettings
- fplCPUCapabilities
- fplCPUIDLeaf
- fplDateTime
- fplDateTimeCreationResult
- fplDateTimeResult
- fplDisplayInfo
- fplDisplayMode
- fplDynamicLibraryHandle
- fplEndianess
- fplEvent
- fplFileEntry
- fplFileHandle
- fplFilePermissions
- fplFileTimeStamps
- fplGamepadButton
- fplGamepadData
- fplGamepadEvent
- fplGamepadInfo
- fplGamepadInputBinding
- fplGamepadMapping
- fplGamepadSettings
- fplGamepadState
- fplGamepadStates
- fplGraphicsApiSettings
- fplImageSource
- fplInputBackendMask
- fplInputBackendSupport
- fplInputDevice
- fplInputDeviceGuid
- fplInputSettings
- fplInternalConditionVariable
- fplInternalDynamicLibraryHandle
- fplInternalFileEntryHandle
- fplInternalFileHandle
- fplInternalFileRootInfo
- fplInternalMutexHandle
- fplInternalSemaphoreHandle
- fplInternalSignalHandle
- fplInternalThreadHandle
- fplKeyboardEvent
- fplKeyboardState
- fplLogSettings
- fplLogWriter
- fplLogWriterConsole
- fplLogWriterCustom
- fplMemoryAllocationSettings
- fplMemoryBlock
- fplMemoryInfos
- fplMemorySettings
- fplMouseEvent
- fplMouseState
- fplMutexHandle
- fplOpenGLSettings
- fplOSVersionInfos
- fplSemaphoreHandle
- fplSettings
- fplSignalHandle
- fplSpecificAudioSettings
- fplThreadHandle
- fplThreadParameters
- fplTimestamp
- fplVersionInfo
- fplVideoBackBuffer
- fplVideoRect
- fplVideoRequirements
- fplVideoRequirementsVulkan
- fplVideoSettings
- fplVideoSurface
- fplVideoSurfaceOpenGL
- fplVideoSurfaceVulkan
- fplVideoWindow
- fplVulkanSettings
- fplWindowCallbacks
- fplWindowDropFiles
- fplWindowEvent
- fplWindowPosition
- fplWindowSettings
- fplWindowSize
- fplX86CPUCapabilities