GithubHelp home page GithubHelp logo

nsglover / openal.netcore Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 14 KB

OpenAL.NETCore is a set of cross-platform C# bindings for OpenAL 1.1 targeting .NET Core.

License: MIT License

C# 100.00%

openal.netcore's Introduction

OpenAL.NETCore

OpenAL.NETCore is a set of cross-platform C# bindings for OpenAL 1.1 targeting .NET Core.

Certain functions listed in the OpenAL specification have been omitted because they have no actual use in the API. For example, for the "alBuffer3i(int, int, int, int)" function, there is no possible value for the first parameter that will not cause the function to throw the AL_INVALID_ENUM error.

This project was inspired by OpenTK, particularly the OpenTK.Audio namespace.

Installation

A NuGet package is on its way. For now, please install OpenAL.NETCore manually.

To install manually, clone this repository, build the assembly, and reference the resulting .dll from your project. Additionally, certain operating systems may require you to install OpenAL itself. See below.

macOS

No additional installation is necessary since the OpenAL framework is packaged with the OS. If you get an error along the lines of "DllNotFoundException: "'/System/Library/Frameworks/OpenAL.framework/OpenAL' could not be found.", then you may be having some other problems with your system.

Linux

Run the following in a terminal:

git clone git://repo.or.cz/openal-soft.git
cd openal-soft
cd build
cmake ..
make
sudo make install

Make sure libopenal.so.1 is in a familiar location (where your package manager typically puts things) and OpenAL.NETCore should find it. If it doesn't, try moving the file to the same directory as your project's executable.

Windows

Please install OpenAL if you do not already have it on your system. It should install a binary named "openal32.dll", which OpenAL.NETCore should find on its own. If not, try moving the .dll to the same directory as your project's executable.

openal.netcore's People

Contributors

nsglover avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openal.netcore's Issues

How to record and save the captured audio on WAV file?

Hi,
Can you please provide some kind of sample code about how to use this library?

The sample project doesn't really help to understand how to use your library.

Do you supporting recording and save to WAV cross-platform?

Alc.GetString(null, Alc.AllDevicesSpecifier) return only the first value

Problem Description

The return value of alcGetString(null, ALC_ALL_DEVICE_SPECIFIER) (and possibly other constants too) is a null-separated string array, in C++ usually handled like:

{
	const char* devices = alcGetString(nullptr, ALC_ALL_DEVICES_SPECIFIER);
	char* dev = (char*)devices;
        std::vector<std::string> *names = new std::vector<std::string>();
	while (dev != nullptr && dev[0] != '\0') {
		int len = strlen(dev);
		printf("- %s\n", dev);
		names->push_back(dev);
		dev += len + 1;
	}
}

/**
* on my PC (Windows 10), the code above prints:
* - OpenAL Soft on Speakers (High Definition Audio Devices)
* - OpenAL Soft on Speakers (Wireless Controller)
* - OpenAL Soft on C24F390 (NVIDIA High Definition Audio)
*/

But, because of the return value is null-separated, using Marshal.PtrToStringAnsi will only return the first value as it works wih null-terminated string where null is used as separator in the value.

Proposed changes

Add another method that convert and return the null-separated string array as a managed string[], Preferably in the form of public static string[] Alc.GetStrings(IntPtr, int);.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.