Git Product home page Git Product logo

Comments (33)

Alexell avatar Alexell commented on July 18, 2024

Maybe FMOD Ex library?

from celestia.

Alexell avatar Alexell commented on July 18, 2024

FMOD Ex will be added.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

Original patch created by Victor (vhpgomes), modified by Vincent,
modified and adapted for FMOD Ex library by Leserg, adapted for FMOD Studio by Alexell.
Done: 37ed932

from celestia.

 avatar commented on July 18, 2024

Need bug fix: source code compilation is not successful.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

Added lost classes in command.cpp
Compile Win32 and QT successfully

from celestia.

 avatar commented on July 18, 2024

Need additional testing, because celestia.exe and celestia qt.exe sometimes crashes with fmod.dll exception

from celestia.

 avatar commented on July 18, 2024

@dbrant, we need help to fix FMOD support to work properly on Win32, Win64, QT, Linux, MacOS.

from celestia.

dbrant avatar dbrant commented on July 18, 2024

I have a couple of concerns about the choice to use FMOD instead of OpenAL, specifically when building for Linux:

  • I'm not familiar with FMOD, but it looks like it's a commercial (closed-source) library. Because of this, it's not available in any package manager of any Linux distribution. Therefore, if a volunteer (like me) wants to start contributing, they would need to manually go to the fmod website, download the libraries (which requires creating an account!), and manually copy the libraries and headers to /usr/local/. That's quite a few steps, and easily enough to turn someone away from contributing.
  • More importantly, since FMOD is closed-source, will it prevent Celestia from being included in the package managers of Linux distros (i.e. allow users to install it with apt-get install celestia)? Again, I'm not familiar with the licensing and distribution agreements of FMOD, but I doubt that Ubuntu or Fedora would agree to distribute Celestia if it starts linking to a closed-source library.

from celestia.

 avatar commented on July 18, 2024

@dbrant, The FMOD website says "Free for small teams".

I wrote a letter for FMOD asking for permission to use FMOD in Celestia. Permission was given, we can use FMOD under the EULA license.
It is written there:

FMOD is distributed as integrated into a Product only

As I understand it, it suits us.

Of course I have an account to download the FMOD libraries (I can send you archives of the library, for example to the email).
Maybe you're right about the possible problem with package managers of Linux distros.
If you think that FMOD is wrong to use in the open-source project, we are ready to listen to your suggestions.

from celestia.

nisselarsson avatar nisselarsson commented on July 18, 2024

FMOD support is guarded with _WIN32 ifdefs now.

from celestia.

 avatar commented on July 18, 2024

It is necessary to use QT Audio.

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

I started branch to add audio support, however I'm confused with current code. What is "channel" argument in playSoundFile function? Is it hardware or OS defined channel, or pure virtual one, defined inside FMOD library? How user (script author) have to know, which channel he shoud use and how many are? What is pan for, if channels are used directly?

from celestia.

 avatar commented on July 18, 2024

@pirogronian Channel is the definition of FMOD. But this is not left, right, or center. For this, there is pan. FMOD must be completely removed from the Celestia code. The new version of Celestia will be built only with QT. And QT has built-in audio support (QT Audio). Please try to understand how it works and include it.

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

@CelestiaProject Qt Audio doesn't have pan support. On the other side, OpenAL is designed to be fully 3D. I don't know if it's outdate or not, but its api looks most usefull from all I have seen working on sound in Celestia.
BTW: on my system, OpenAL is a dependency of Qt5-multimedia :-)

from celestia.

 avatar commented on July 18, 2024

@pirogronian In general, we do not need PAN support. Although sometimes in scenarios, using panning sound would be interesting. Should we include a third-party library for PAN support?
Let's discuss. In what way can you support audio in mp3 and wav formats (at least the basic commands: play, pause, stop, volume, loop)?

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

For simple layback, Qt will be completely suffcient, I think. And I can implement it with script interface almost identical to this, desgned for FMOD.

from celestia.

 avatar commented on July 18, 2024

@pirogronian Please do it.
To start, please completely remove the FMOD includes from the source code, then replace the parts of the code that cause the FMOD to play audio to the code for QT. All the changes made earlier for audio playback you can see in this commit: 37ed932
Before making any changes, please perform a pull from GitHub of today's changes (one of your your pull request) in Git.
Please, after the playback through QT is ready, check that Celestia is successfully compiled, and also check the correctness work of the demo scripts from the scripts/audio folder.
When everything is checked and it will work normally, we wait for your pull request.

P.S. If you have ideas for future changes in Celestia in the future, we can add you to the contributors so that you can make changes to the repository directly, without pull request.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian Celestia code with latest changes compilation failed with QT 5.9.2 (release MSVC2015 32bit/64bit and MinGW 32bit).
Swears that identifiers are not found in celx.cpp:

luaL_newstate
lua_iolibopen
lua_baselibopen
lua_mathlibopen
lua_tablibopen
lua_strlibopen

Can you fix it?

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

It's probably due to different direction of iteration over lua versions list in celestia.pro. What works on my system,, fail on yours and vice versa. Solution would be rewrite of version detection. However, I have to think on it yet.
Edit: Fixed.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian Unfortunately, nothing has changed. All the same errors in the celx.cpp file
Your changes were in the unix section, and I'm talking about compiling Windows x86/x64

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

My story is following: once I pulled changes to prepare playback commit, compilation blew up with the same errors, as @Alexell mentioned. I discovered this lua version detection loop in unix section of celestia.pro and reverted list, which fixed problem. So, when AlexelI posted about the issue, I though it's due my reverted list. But in this situation it's probably related to this commit by @375gnu. Based on my experiences, this is probably due to wrong LUA_VER macro value on win32/64.

@Alexell
Edit: All errors match premise, that LUA_VER is not set on windows platform, expect luaL_newstate. Are You sure it's not lua_open, instead of luaL_newstate? In this case set LUA_VER inside win section should fix it.

Edit2: As mentioned in comment by @375gnu,

Windows and OSX build are not affected because they have Lua 5.1 hardcoded.

So LUA_VER = 0x50100 for windows and macosx shoud fix it.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian Yes, these were the errors of luaL_newstate and other identifiers that I pointed out. Now at compilation of these errors already is not present, but there are others, concerning QtAudioManager. If I can not fix them, I'll write about it.

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian You forgot to modify the audio playback for .cel scripts, and also used the construct fpath.cd (CONFIG_DATA_DIR);, which does not work and is not needed on Windows, I wrapped it in #ifdef Q_OS_LINUX in my commits. Now audio playback works correctly on Windows x86 & x64. Please check work .cel & .celx audio scripts in Linux with my last commits.
But I do not understand the real purpose of the nopause parameter. While the script is running under any conditions, pressing the space bar stops the script, but does not pause audio.
In the description of the scripts it is written that when nopause=false, pressing the spacebar will pause audio playback.
With nopause=false, does not work loop=true.

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

In fact, I didn't forget about *.cel, just didn't know what it is and where is its code. Additionally, errors throwed by cel scritps were without any description.
When I tested nopause parameter, setting it to false caused stopping playback after pressing space. Will check it again, probably tomorrow. Thanks for response.

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

Just checked. Celx script works with audio, however, indeed, nopause parameter don't work. Cel script has no audio and no console output.
(Celx debug output, I forgot to remove it before submit PR):

playAudioFile(0, 1, 1, music.mp3, 1)
playAudioFile(1, 1, 0, comment.mp3, 0)
playAudioFile(0, 0.8, 0, -, 0)
playAudioFile(0, 0.6, 0, -, 0)
playAudioFile(0, 0.4, 0, -, 0)
playAudioFile(0, 0.2, 0, -, 0)
playAudioFile(0, 0.1, 0, -, 0)
playAudioFile(0, -1, 0, , 0)
playAudioFile(1, -1, 0, , 0)

So, cel script don't ever call playback function.
Where to look for Cel script operation code?

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian You are not right. Your PR did not realize the call to the audio playback function in the CEL script. But I fixed it. Please compile the current version of the Celestia source code. The function is called almost the same as for CELX and it works fine on Windows x86/x64.
But I did not see any output to the console (Shift + ~).
For CEL, this is described in the files:

src/celengine/cmdparser.cpp
src/celengine/command.cpp
src/celengine/command.h

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

@Alexell By console, I mean command line, where one can see standard output. On windows, it should be accessed by run celestia via cmd.exe.
Just found it: Qt doesn't play sound on other devices on stackoverflow.com. It's about Windows platform and has solution.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian On Windows the sound works, I wrote earlier. At first it did not work, because there were not enough dlls.

from celestia.

pirogronian avatar pirogronian commented on July 18, 2024

@Alexell indeed, I confused "now" with "no"... So, when my pause fix will be commited, will this issue be finally closed?

from celestia.

Alexell avatar Alexell commented on July 18, 2024

@pirogronian After PR merge, I'll also check loop and nopause parameters conformity for the description, which is written for them in demo scripts.

from celestia.

Alexell avatar Alexell commented on July 18, 2024

Everything is working.

from celestia.

Related Issues (20)

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.