Suggestion A sound sample module?

Midimaster

New Member
Joined
Jun 20, 2020
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?
 

dawlane

Well-Known Member
CX Code Contributor
Joined
Jun 21, 2017
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.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Wait, someone posted about his sdl_mixer module in the user module section. Maybe it has what you need.
 

Midimaster

New Member
Joined
Jun 20, 2020
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?
 

ddabrahim

Active Member
Joined
May 3, 2020
Location
Cyberspace
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.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
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.
 

Jimmy

Active Member
Joined
Jan 2, 2020
Doesn't ANDROID NDK target support solve this kind of things?

OBOE looks really interesting!
 

Midimaster

New Member
Joined
Jun 20, 2020
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.
 

Midimaster

New Member
Joined
Jun 20, 2020
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.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
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.
 

Holzchopf

Moderator
3rd Party Module Dev
Joined
Jul 31, 2017
Location
Bern, Switzerland
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 =)
 

Jimmy

Active Member
Joined
Jan 2, 2020
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
 

Jimmy

Active Member
Joined
Jan 2, 2020
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.
 
Top Bottom