Add README outline,

This commit is contained in:
2024-08-30 04:28:40 -05:00
parent 84fde1aff4
commit c1c5969058
2 changed files with 96 additions and 10 deletions

View File

@@ -12,18 +12,15 @@ include(cmake/CPM.cmake)
CPMAddPackage(
NAME uuid
URL https://git.redacted.cc/Redacted/uuid/archive/Release-1.zip
)
URL https://git.redacted.cc/Redacted/uuid/archive/Release-1.zip)
CPMAddPackage(
NAME Event
URL https://git.redacted.cc/josh/Event/archive/Release-11.zip
)
URL https://git.redacted.cc/josh/Event/archive/Release-11.zip)
CPMAddPackage(
NAME jlog
URL https://git.redacted.cc/josh/jlog/archive/Prerelease-15.zip
)
URL https://git.redacted.cc/josh/jlog/archive/Prerelease-14.zip)
if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-Source builds are not allowed")
@@ -36,7 +33,6 @@ if(UNIX AND NOT APPLE)
endif()
if(WIN32)
file(GLOB_RECURSE HEADERS "include/ReMixer/*.h")
file(GLOB_RECURSE SOURCES "src/shared/*.cpp" "src/windows/*.cpp")
endif()
@@ -50,13 +46,11 @@ add_executable(ReMixer-Test main.cpp)
set_target_properties(ReMixer PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(ReMixer-Test PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(ReMixer PUBLIC ${uuid_SOURCE_DIR}/include)
target_include_directories(ReMixer PUBLIC ${Event_SOURCE_DIR}/include)
target_include_directories(ReMixer PUBLIC ${jlog_SOURCE_DIR}/include)
target_link_libraries(ReMixer PUBLIC Event jlog)
target_link_libraries(ReMixer PUBLIC jlog Event)
if(UNIX AND NOT APPLE)
target_link_libraries(ReMixer PUBLIC vorbisfile vorbis pulse-simple pulse uuid)

92
README.md Normal file
View File

@@ -0,0 +1,92 @@
# ReMixer - A C++ Sound Library
![](https://img.shields.io/badge/Redacted-Software-black)
![Static Badge](https://img.shields.io/badge/Lit-Based-%20)
![C++](https://img.shields.io/badge/C%2B%2B-20-blue)
[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue)](http://unlicense.org/)
ReMixer is a cross-platform audio library for C++ that supports sound playback, recording, and mixing. It provides a unified API for working with various audio backends, making it easier to develop audio applications without worrying about platform-specific details.
## Features
* Cross-Platform - A single API covers them all!
* Windows
* WASAPI Backend - On The Roadmap
* Linux
* PulseAudio Backend - In Prorgress, Does Work.
* C++20
* Sound Playback, Recording, and Mixing.
* Supports OGG Vorbis, and raw PCM binary sound files.
## Dependencies
* PulseAudio Libraries
* Fedora: `dnf install pulseaudio-libs-devel`
* Vorbis Library
* Fedora: `dnf install libvorbis-devel`
## Supported Compilers
* GCC 14.2
## Installation
## Basic Usage
Here's a simple example demonstrating how to use the ReMixer library for audio playback:
```cpp
#include "ReMixer.h"
#include <chrono>
int main() {
using namespace ReMixer;
using namespace std::chrono_literals;
// Set the sample rate
uint measurement = 44.1_kHz;
// Create an instance of PulseAudioSubsystem
PulseAudioSubsystem test = PulseAudioSubsystem("PulseAudio Test");
// Create audio streams
PulseStream test_stream = test.CreateStream("Test Stream");
PulseStream test_stream2 = test.CreateStream("Another Test Stream");
// Load audio files
Sound test_sound = Sound::FromPCMFile("output.raw");
Sound ogg_test_sound = Sound::FromOGGVorbisFile("song.ogg");
// Play audio
test.Play(test_stream, test_sound);
//test.Play(test_stream2, ogg_test_sound);
// Keep the application running
while (true) {
// std::this_thread::sleep_for(25ms);
}
return 0;
}
```
## Examples
For more advanced usage and examples, refer to the examples directory in the repository.
## Documentation
Documentation is automatically generated for the latest commit, and is hosted at https://doc.redacted.cc/ReMixer .
## Contributing
You know the drill, send those pull requests.
## License
ReMixer is licensed under the MIT License. See the LICENSE file for more details.
## Contact
For questions or support, please contact your-email@example.com.