Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔬Look into replacing openal with raylib #290

Closed
9 of 11 tasks
CalvinWilkinson opened this issue Aug 31, 2023 · 1 comment
Closed
9 of 11 tasks

🔬Look into replacing openal with raylib #290

CalvinWilkinson opened this issue Aug 31, 2023 · 1 comment
Assignees
Labels
medium priority Medium Priority 🔬research Research collection / investigation

Comments

@CalvinWilkinson
Copy link
Member

CalvinWilkinson commented Aug 31, 2023

Complete The Item Below

  • I have updated the title without removing the 🔬 emoji.

What To Research

Look into possibly replacing OpenAL with raylib.

Things to research:

Note

There is a type in raylib that lets you play a sound but only 1 at a time. There is also another type that ends with multi used for playing multiple sounds at once. This will be important for games.

Create a prototype for these various things to test

Research Results

Warning

There is an issue currently where raylib crashes when an audio device changes.
What this means is if you have headphones and you turn the headphones off, the operating system will change
to the next default audio device, but raylib will not and it will crash.
There is an open issue in the repository for this.


Software vs Hardware Rendering

It is unknown for sure but from the research, it seems that it does not matter in the end.
Raylib uses the C library miniaudio.

This is what I found during my research:
Miniaudio is a low-level library that provides an interface to the underlying audio devices on your system1. It supports playback, capture, full-duplex, and loopback1.

The library gives you access to the raw audio data of an audio device1. It allows you to choose a physical device to emit or capture audio from, and then move data to/from the device when miniaudio tells you to1. Data is delivered to and from devices asynchronously via a callback which you specify when initializing the device1.

However, the actual rendering of the audio - whether it’s done in software or hardware - is typically handled by the underlying audio system of the operating system, not by the miniaudio library itself. The library’s role is more about providing a convenient and portable way to interact with that system.

So, in summary, miniaudio itself doesn’t directly handle software or hardware audio rendering. It provides a way to send and receive audio data to/from the audio devices, and the actual rendering is handled by the underlying system. This approach allows miniaudio to be lightweight and portable across different platforms and audio systems.


Audio Play/Pause/Restart

Audio can be played, paused, and restarted.
Go here for a sample of how it is done.


Multiple sounds

Raylib does support the use of multiple sounds playing at the same time.
An example of this can be found [here](Impact of using multiple sounds)


Licensing

All raylib components use the ZLib License. There won't be any issues/conflicts with using this software in terms of licensing.

zlib License

Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)

This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you
    wrote the original software. If you use this software in a product, an acknowledgment
    in the product documentation would be appreciated but is not required.

  2. Altered source versions must be plainly marked as such, and must not be misrepresented
    as being the original software.

  3. This notice may not be removed or altered from any source distribution.

Acceptance Criteria

This issue is finished when:

  • Research complete and issues created (if needed).
  • If any issues were created, they have been added to the Related Work section below.

ToDo Items

  • Priority label added to this issue. Refer to the Priority Type Labels section below.

Issue Dependencies

No response

Related Work

No response

Additional Information:

Priority Type Labels

Priority Type Label
Low Priority low priority
Medium Priority medium priority
High Priority high priority

Code of Conduct

  • I agree to follow this project's Code of Conduct.
@CalvinWilkinson CalvinWilkinson added medium priority Medium Priority 🔬research Research collection / investigation labels Aug 31, 2023
@CalvinWilkinson CalvinWilkinson self-assigned this Aug 31, 2023
@CalvinWilkinson
Copy link
Member Author

It was decided after doing this research to not use raylib. The reason is due to the lack of some of the control as well as how it works. It CAN be done successfully, but the need to have maximum control has drove the decision to keep using OpenAL to get these benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium priority Medium Priority 🔬research Research collection / investigation
Projects
Archived in project
Development

No branches or pull requests

1 participant