Giter Club home page Giter Club logo

yse-soundengine's Introduction

This is libYSE 2.0

libYSE is a cross platform sound engine, written in C++. The 1.0 version was built with JUCE, but because of possible licensing isssues and the current JUCE being unable to create usable Android libraries, JUCE support is removed in libYSE 2.0. Currently Windows, Linux and Android are supported.

Nuget

If you use YSE with C#, a few nuget packages are available. For windows you need https://www.nuget.org/packages/Yse.NET.Standard/. (YSE.NET.PCL is a dependency and will be loaded automatically.)

With Android, you can use https://www.nuget.org/packages/Yse.NET.Android/. For Xamarin Forms, add Yse.NET.Android and YSE.NET.PCL to your Android Project, and add YSE.NET.PCL to your Xamarin Forms project. An example of this usage is available in the Demo.Xamarin.Forms project inside this repository.

Windows Support

There is a native C++ library, compiled with Visual Studio. It uses libsndfile and portaudio a backends. A .NET framework library is also included.

Android Support

The native android library is also created with Visual Studio. It uses libsndfile and openSLES backends. Compiling it on linux should be possible if you create the makefile to do that.

The .NET android library also provides support for C# Android applications in visual studio. Using Xamarin Forms is also possible.

There is one drawback right now: I could not find a way to pass the asset manager to the native library, making it impossible to read assets from an apk. I will work on that later. For now, a workaround is to use the BufferIO class. By reading audio files into a memory buffer, they can be passed to libYSE from .NET. This is not ideal if you have big audio files though.

Linux Support (thanks to user noondie)

Building on Linux is supported by cmake. PortAudio and libsndfile are the only dependencies for YSE. Do the following in the main directory

$mkdir build 
$cd build 
$cmake ..

iOS/Mac Support

This was also supported in YSE 1.0, but had to go when I decided to remove the dependency on JUCE. Adding support would mean adding other backends for reading files (which is done by libsndfile now) and streaming audio output (openSLES on Android and portaudio on Windows). The library is currently written with supporting multiple backends in mind, so it can't be that hard. Currently I don't have time to do this though.

Libraries

Native C++ libraries are working, as well as libraries for C# (.NET framework and .NET standard). The project also includes wrappers for use with xamarin forms.

Demo

Demo projects are also included for Windows (Native/C++ and WPF/C#), Android (Native/C++, Android.NET/C# and Xamarin.Forms).

yse-soundengine's People

Contributors

noondie avatar yvanvds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yse-soundengine's Issues

Add reverb on wav file

I am working on a Android project to add reverb to wav file or PCM io stream. I find it is hard for yse-soundengine to realize it, because it is seems like a audio play engine. The DSP code is hard to decoupling, can you give me some help to realize it?

Compile android native Android studio 3.5

Hello,
I'm unable to build the library using the android native example.
Seems that Cmake is unable to find rtmidi headers even if I explicitly add the include_directories with the folder path.
Can you please provide some help?

Thanks!

after using system().init() func ,my game can reach 60 fps

before i use this engine, it seems there is a problem with my fps limit, i don't know which part affected the thread sleeping or
clock accuracy. when adding a Sleep(16) into my game loop ,it only have 32 fps. (it should be 60 because 1000/60 = 16.66 ) Sleep(8) can reach to 64fps, it's wrong
when i use yse 1.0 , this fps wrong limit problem has gone;
so what func is use in yse 1.0 have fixed my fps limit problem.

                     before  use  yse        |         use   yse
          code           Sleep(1000/60)       |        Sleep(1000/60) 
          running result      32fps             |              60fps

by the way, i have sound play problem in yse 2.0. i use files in the folder YseCppRelease to build. but the sound's isValid() value is false

bad english,forgive me.

android binary release problem.

Hey @yvanvds , i've been trying to set up the library for linux and android.
In the linux system, i cannot find a way to build it because the binary is not provided. Not even build files for it.
In android i tried to integrate it with a qt app that i have, but the library fails when i try to use the system, init it or whatever. The problem is with the android:
The code i execute:

bool inited_yse = YSE::System().init();

The result i get :
I/Timeline(16078): Timeline: Activity_idle id: android.os.BinderProxy@1fb70daf time:162989616
I/JUCE (16078): JUCE Assertion failure in juce_android_SystemStats.cpp:106
F/libc (16078): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 16260 (QtThread).

From what i could see the juce_android_SystemStats.cpp, is that the AndroidEnv is null which leaves me nowhere as i don't know anything about JUCE.

Any ideas?

Yse 2.0 Mac/IOS port -> cmake

Hey Guys,

Great news for this year. So the code should be easily ported, @yvanvds we need a list of the libraries used/required for the engine for those without windows machines.

I am trying to get this working with Qt under Mac Os, just for testing.

Building yse for visual studio

I just found about yse and it really looks like the library I need for my game but I'm not able to build yse and mos the issue seem to be around configuring juce and liking yse against it.

Is there a tutorial or anything about this?

Separate the audio processing from backends and file loaders?

In issue #7 it is mentioned that some (including me) are not liking the use of JUCE in this library. In issue issue #1 / issue #8 there is the licensing problem making this library essentially useless to anyone that doesn't have a commercial JUCE license.

So i propose an alternative option, refactor the library and just stick to audio processing? There are plenty of libraries out there to handle audio output, and format loading. This would remove the need to add and maintain support for all of the various platforms/APIs and file formats.

So refactor the library to separate the core audio processing from the higher level stuff. Make the core of the library completely cross platform moving it into only a processing role. There would have to be a method of getting PCM audio data to and from the application for the various inputs and outputs. If you wanted to still provide the api you have now, you could use this "core" api under the hood.

I guess the downsides of this would be that it would move the api to being lower level...

And if you don't want to do this why not change the license to something GPL compatible, and let others try to take this on. Because I think a library like what is described here could take over the world.

which music format can i use in yse?

I was failed to register an account in forum, so i post my question at here.

  1. Which format can I use? can I use both mp3 and wav?
  2. Can you provide binary distribution for ios and mac, i have some trouble in building them.

re: Android file path storage for assets--

Awesome library ...thankyou!

am prototyping some realtime synthesis for my android app at the moment ... am using android studio and kotlin ... however, it would be very useful to have access to files ... want to do some dsp on incoming microphone streams and some loop sampling ...
...have you seen this thread?
https://stackoverflow.com/questions/6346889/how-to-reference-an-asset-in-a-library-project
and this::
https://github.com/donkirkby/webandnative/blob/assets/android/.project#L33

Dependencies location & repo location

Hi,
I am looking into getting YSE on Cmake but to make the project not rely on prebuilt libraries, would you be willing to make copy/forks of these repos off your username or a team repo?

If so maybe consider making a yse sound engine organization to allow for team members and other benefits. I made a org that you can take over @ https://github.com/orgs/YSE-SoundEngine/

Fails to build on debian

After running:
mkdir build
cd build
cmake ..
make
I get the following error:
In file included from /home/avasile/src/yse-soundengine/YseEngine/synth/../midi/../internalHeaders.h:48:0,
from /home/avasile/src/yse-soundengine/YseEngine/synth/../midi/midifileImplementation.h:15,
from /home/avasile/src/yse-soundengine/YseEngine/synth/synthImplementation.h:20,
from /home/avasile/src/yse-soundengine/YseEngine/internalHeaders.h:27,
from /home/avasile/src/yse-soundengine/YseEngine/channel/channelManager.h:18,
from /home/avasile/src/yse-soundengine/YseEngine/internalHeaders.h:16,
from /home/avasile/src/yse-soundengine/YseEngine/listener.cpp:11:
/home/avasile/src/yse-soundengine/YseEngine/synth/../midi/../device/portaudioDeviceManager.h:21:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"

At which point the compilation fails. There is a portaudio.h. There is a portaudio.h under yse-soundengine/dependencies/portaudio/include/portaudio.h

YSE engine init unsuccessfully after close

my code:
YSE:System().init();
create Sound........
YSE::System().close();
all go well;
I open YSE engine again
YSE::System().init();
create Sound()....
Sound can not play.
Why??
Thanks a lot!

/////////////////////////////////////////////////
void go()
{
YSE::System().init();
YSE::System().close();
YSE::System().init();
createSound..........
can not work!!!
}
/////////////////////////////////////////////

What modules of juce are used in the project and for what?

Hello again @yvanvds ,

Now that i am going through the library, it feels that JUCE dependencies are not so nice in terms of fees and licensing.
What parts of the JUCE library is used in yse, and what are they used for?

I came to the idea of try to build it around sdl, which provides some of those audio formats and it has a better license. And more attractive to developers. ;)

Tell me what you think about it.

Sound artifacts on .NET Core 6 and x64 builds

Hi, I've trying to use YSE in my .NET Core project but there were no releases since 2018 (1.0.66). On .NET Framework sound works great, but on .NET Core it produces some strange artifacts. Pre-Built libraries are only x86 and though I've compiled x64 version of Yse.dll, native examples started to behave like my attempts at running YSE with .NET Core project. Maybe I've done something wrong while compiling it, but there's no instructions on how to do that, so can't really say much, especially since YSE C# demo project running on .NET Core 6 instead of .NET Framework using the nuget package (1.0.66) produces the same effect.

2022-08-14.16-36-18.mp4

(Attached only x64 native video, since the result in .NET Core is exactly the same)

P. S.: Not really useful, but eh: YSElog.txt

Linux build error = fatal error: RtMidi.h: No such file or directory

I got the following error at 1% of the build process when trying to build on ubuntu 18.04 (Arm64 CPU):

/media/tetsfr/SSD/yse-soundengine/YseEngine/synth/../midi/../midi/midiDeviceManager.h:2:10: fatal error: RtMidi.h: No such file or directory
#include "RtMidi.h"
^~~~~~~~~~
compilation terminated.

Here is my cmake output, all looks fine to me:

yse-soundengine/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
The package name passed to find_package_handle_standard_args (PkgConfig)
does not match the name of the calling package (Portaudio). This can lead
to problems in calling code that expects find_package result variables
(e.g., _FOUND) to follow a certain pattern.
Call Stack (most recent call first):
/usr/local/share/cmake-3.18/Modules/FindPkgConfig.cmake:59 (find_package_handle_standard_args)
FindPortaudio.cmake:20 (include)
CMakeLists.txt:20 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'portaudio-2.0'
-- Found portaudio-2.0, version 19
-- Found Portaudio: portaudio;asound;m;pthread
-- Checking for module 'sndfile>=1.0.11'
-- Found sndfile, version 1.0.28
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /media/tetsfr/SSD/yse-soundengine/build

=> Can you help please ? did I miss a dependency (I have done a sudo apt-get install librtmidi-dev but that did not fix the problem)

Possible licensing issue with JUCE

While @TexKiller was searching for a replacement of OpenAL for SFML, he stumbled up on YSE, which sounded interesting up to the point, where the whole audio input and output is handled via JUCE. While chatting about the different licenses, it has come to my attention, that YSE might have a licensing issue.
My understanding (1, 2) is that YSE uses JUCE for audio input/output. But if it does so, which version of JUCE does one have to use? Since nothing else is mentioned and this is an open source project, it seems logical to pick the open source version of JUCE. But by doing so, one chooses the GPL license, which was desinged to inject itself into user code, meaning if YSE uses the GPL JUCE, YSE would need to be GPL as well and couldn't use its Eclipse license.
If YSE was meant to be used with a commercial license of JUCE, it would be important to document this. Whether you could then release your code under the Eclipse license, is beyond my understanding of the legal situation (i.e. ask a lawyer).

I simply wanted to bring this issue to your attention. So what is your input on this?

If there's really a licensing issue, would it be possible to strip the JUCE bits and use "something" (not sure what) else?

Python wrapper?

Hi thanks for this great project!
By any chance, is there a python wrapper lib available or is c++ the only way?
Thanks again

YSE engine init unsuccessfully after close

my code:
YSE:System().init();
create Sound........
YSE::System().close();
all go well;
I open YSE engine again
YSE::System().init();
create Sound()....
Sound can not play.
Why??
Thanks a lot!

/////////////////////////////////////////////////
void go()
{
YSE::System().init();

YSE::System().close();

/////////////////////////////////////////////

YSE errors when used within custom static library

I'm trying to use YSE within a static game engine library I'm writing, but when it comes to compiling, I get: C2059 syntax error: '__cdecl' synth.hpp line 37 (CALLBACK,)
C3805 '__cdecl': unexpected token, expected either '}' or a ',' at the same line in synth.hpp
C2059 syntax error for "RELATIVE" at line 36 in sound.hpp
And both having errors (abc) saying "expected an identifier.

To make sure that the YSE library worked, I created a simple console application just to play a sound and it worked flawlessly. So I don't know what the issue may be when I try to use it with my library. The only other libraries in my engine are glm, Bullet Physics, Assimp and Vulkan.

Linux build?

I see that linux is supported and everything, sadly in the releases section there is no yse linux binary. And the build scripts are not provided. Am i missing something.

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.