mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 10:17:41 +00:00

This implementation is very naive compared to the PulseAudio one. Instead of using a callback implemented by the audio server connection to push audio to the buffer, we have to poll on a timer to check when we need to push the audio buffers. Implementing cross-process condition variables into the audio queue class could allow us to avoid polling, which may prove beneficial to CPU usage. Audio timestamps will be accurate to the number of samples available, but will count in increments of about 100ms and run ahead of the actual audio being pushed to the device by the server. Buffer underruns are completely ignored for now as well, since the `AudioServer` has no way to know how many samples are actually written in a single audio buffer.
44 lines
1.1 KiB
CMake
44 lines
1.1 KiB
CMake
set(SOURCES
|
|
GenericTypes.cpp
|
|
SampleFormats.cpp
|
|
Loader.cpp
|
|
RIFFTypes.cpp
|
|
WavLoader.cpp
|
|
FlacLoader.cpp
|
|
FlacWriter.cpp
|
|
WavWriter.cpp
|
|
Metadata.cpp
|
|
MP3Loader.cpp
|
|
PlaybackStream.cpp
|
|
QOALoader.cpp
|
|
QOATypes.cpp
|
|
UserSampleQueue.cpp
|
|
VorbisComment.cpp
|
|
)
|
|
|
|
if (SERENITYOS)
|
|
list(APPEND SOURCES ConnectionToServer.cpp)
|
|
list(APPEND SOURCES ConnectionToManagerServer.cpp)
|
|
list(APPEND SOURCES PlaybackStreamSerenity.cpp)
|
|
set(GENERATED_SOURCES
|
|
../../Services/AudioServer/AudioClientEndpoint.h
|
|
../../Services/AudioServer/AudioServerEndpoint.h
|
|
../../Services/AudioServer/AudioManagerClientEndpoint.h
|
|
../../Services/AudioServer/AudioManagerServerEndpoint.h
|
|
)
|
|
endif()
|
|
|
|
if (HAVE_PULSEAUDIO)
|
|
list(APPEND SOURCES
|
|
PlaybackStreamPulseAudio.cpp
|
|
PulseAudioWrappers.cpp
|
|
)
|
|
endif()
|
|
|
|
serenity_lib(LibAudio audio)
|
|
target_link_libraries(LibAudio PRIVATE LibCore LibIPC LibThreading LibUnicode LibCrypto)
|
|
|
|
if (HAVE_PULSEAUDIO)
|
|
target_link_libraries(LibAudio PRIVATE pulse)
|
|
target_compile_definitions(LibAudio PRIVATE HAVE_PULSEAUDIO=1)
|
|
endif()
|