• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Suggestion A sound sample module?

Midimaster

New member
Joined
Jun 20, 2020
Messages
4
Hi, I was very active on blitzforum until two years ago. Now I'm happy to see that the monkey project is still alive. At the moment I try to transfer a blitzmax app to android and want to use CERBERUS X. But unfortunately I see, that there are nearly no modules to manipulate sounds like it was possible on BlitzMax. What I would need is a loader for WAV audio samples and a way to manipulate them. At the end I would like to use this RAM block as a source for the PlaySound command as it was possible in BlitzMax:
Code:
Local Sample:TAudioSample=LoadAudioSample(FileName$)
Local Work:TStream= CreateRamStream(Sample.samples,Sample.Length*2,1,1)
....
ReadySound:TSound=LoadSound(Sample)
Channel:TChannel=PlaySound(ReadySound)

The Audiofiles have a length of typically 3-5min. and size of 10-20MB, 16bit-MONO 48kHz or 44.1kHz. Does anybody have experiences with this in CERBERUS?
 
Due to MonkeyX and CerberusX supporting a number of platforms and devices, some of these having limitations. Sound manipulation is limited.
See mojo.audio.

If you need more complex sound operations, then you would have to write your own.
 
I could look into extending the desktop platforms at least. OpenAl was used in BMax, right?
 
Wait, someone posted about his sdl_mixer module in the user module section. Maybe it has what you need.
 
BlitzMax used FreeAudio in general.

FreeAudio was already perfect when you planed only to work with only loading audio, manipulate it and at the end streaming it to Audio-Ou-Devices. OpenAL was also possible, I used it often for recording functions. But CreativeLabs stop supporte since years.

For my next project on Android I do not need recording but only playback

I now did a research, what ANDROID developers would use. It is a C++ library called OBOE. This offers deep manipulation of sample, audio streams, devices, in playback and recording with mutlichannels. (also the SDL_MIXER is avaiable from OBOE). OBOE also care about different android versions and uses different libraries depending on target android version.

But is there a possiblily to "connect" such a c++ module like OBOE in monkey? a wrapper?
 
is there a possiblily to "connect" such a c++ module like OBOE in monkey? a wrapper?

I am a complete beginner so I am not sure if this is possible but when I was reading the docs I did read about the Extern directive that allow us to connect Cerberus X code to native code. According to the docs, we can use variables, classes, functions declared in native languages like C++, JavaScript and Java:

I did not have a chance to try this yet but it is sounds like we should be able to bring 3rd party libraries written in native code in to CX code.
 
The problem with OBOE is that it is native c++ not native JAVA. Our Android target is pure JAVA with the exception of to convertion routines in native c++. So till I dive into the ability to add support for these bindings, I can only see it happen when there is a target that adds it in the background. I am all interested in a more advanced solution for CX reagrding sound manipulation. But I can-'t promise when it will happen.
 
Doesn't ANDROID NDK target support solve this kind of things?

OBOE looks really interesting!
 
I agree with ddabrahim...
Yes, I think the most relevant disadvantage of monkey are the missing modules. The language itself is already very comfortable, but when I compare it with old BlitzMax... BlitzMax had a lot more modules for handling special file formats or devices. And there have been a lot of modules, which wrapped important libraries.
CERBERUS future development should target in this direction. I think a lot of user of an language like CERBERUS expect to be able to code everyrthing they need inside this dialect.

I'm not that computer freak, that I can write wrappers or bindings. because this always means beeing very experienced in more that one language.

Yesterday I found B4X... The concept looks like beeing more prepared for using existing JAVA modules. But I'm not sure, if this already forfills my needs.
 
Writing java wrappers for cx is more easy.
But I had a look in the CERBERUS module list, and there are nearly no new modules in 2019/2020. The monkey project is lacking freaks like (Blitzmax's) Simon or Brucey, who offered a lot of fundamental coding for simple users like me.

I still work with old BlitzMax and do not miss anything. Alle my PC and MAC project can still be done (very fast) with this. I'm happy, that Bruze keeps the project alive.
 
As you love blitzmax, it is alive with bmax ng is targeting Android es well. It would be natural for you to use it. That is my recommendation for you.
 
there are nearly no new modules in 2019/2020

That's no quality characteristic ;) besides, sometimes new functionality is provided via update of existing modules, e.g. cerberus.interpolate

The monkey project is lacking freaks like (Blitzmax's) Simon or Brucey, who offered a lot of fundamental coding for simple users like me.

Well yes, that might be true. But the reason might be: Cerberus X aims at game creation for different platforms and it's pretty good at it. If something IS missing, we need a hint. This very thread is an example =)
 
This very thread is an example =)

I could start to give some boost and inspiration for others.

Here I take most ideas from from BMX and different Monkey versions.

CX needs to have
---------------------
Example of networking e.g. https http2 websockets
Example of more advanced multitouch
Example of files & intents on android
Example of inline native code of all platforms
Example of handling lower resolutions efficiently (with or without scaling and rotation)
Example of threads & timers
Example to access platform-specific hardware e.g. a printer or a tilt sensor

Libraries & APIs
----------------
A low-level audio library e.g. OBOE
A Metal and Vulkan support
 
The language itself is really mature so for me personally I would not like to change it.

Connecting the language itself to actual features becomes important though to have actual use for it.
 
Back
Top Bottom