Skip to content

Commit

Permalink
Add a LAF file player example
Browse files Browse the repository at this point in the history
This is an object-based audio file format, allowing for more flexible channel
arrangements instead of the fixed quad, 5.1, 7.1, etc layouts (including with
height), along with dynamic movement of channels, where they'll be mixed in
real-time according to the device configuration.

Its primary drawback is the lack of any real compression, supporting only 8-,
16-, and 24-bit integer and 32-bit float PCM. Although it is capable of
skipping seconds-long periods of silence for each track, such space-saving
measures could be better served with proper compression like FLAC or Opus, the
latter of which at least is unlikely to work without some redesigns to the
format.

Regardless, this example player is still effective at showing how object-based
audio formats in general can be played with OpenAL, and can be adapted or
updated to other formats that may exist now or in the future.
  • Loading branch information
kcat committed Jul 27, 2024
1 parent aafaf6c commit 3b10c6f
Show file tree
Hide file tree
Showing 2 changed files with 717 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1688,8 +1688,12 @@ if(ALSOFT_EXAMPLES)
target_link_libraries(alrecord PRIVATE ${LINKER_FLAGS} al-excommon ${UNICODE_FLAG})
set_target_properties(alrecord PROPERTIES ${DEFAULT_TARGET_PROPS})

add_executable(allafplay examples/allafplay.cpp)
target_link_libraries(allafplay PRIVATE ${LINKER_FLAGS} alcommon al-excommon ${UNICODE_FLAG})
set_target_properties(allafplay PROPERTIES ${DEFAULT_TARGET_PROPS})

if(ALSOFT_INSTALL_EXAMPLES)
set(EXTRA_INSTALLS ${EXTRA_INSTALLS} altonegen alrecord)
set(EXTRA_INSTALLS ${EXTRA_INSTALLS} altonegen alrecord allafplay)
endif()

message(STATUS "Building example programs")
Expand Down
Loading

0 comments on commit 3b10c6f

Please sign in to comment.