• 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

Any interface to MediaPlayer.Audio ?

stolm

New member
Joined
Sep 10, 2020
Messages
3
Hello;

Been developing in Monkey/Cerberus for a while, and in thinking about a current issue that I was having, though I would see if Cerberus could deal with it.

I have an Android Card stereo, with a largish external SDD chucked full of my encoded CD collection. The goal was to write a quick MP3 player app that would just randomly grab files from the SDD and play them one after another (alternatively, I can generate a random playlist and use that).

However, in order to do these things, it seems like the MediaPlayer.Audio interface needs to be used, and other than the ability to dump an MP3 file in the data directory and play that (no issues), I have not been able to get Cerberus to find any MP3 files in the /Music directory, let alone play one (using the specific path to it).

So is this sort of functionality possible with Cerberus (access to the MediaPlayer database)? And if so is it documented anywhere?

Alternative option: Does Monkey/Cerberus have a code pass through pragma? Titanium has this where you can specify "target code" that is not translated, but merely copied in place to the target source file.
 
Last edited:
Can you post the loading command?

Something simple like this:
String filepath = Environment.getExternalStorageDirectory()+"/SD Card/Music/samplefile.mp3";
mediaplayer = new MediaPlayer();
mediaplayer.setDataSource(filepath);
mediaplayer.prepare();
mediaplayer.start();

Would work as the next step (hard coded mp3 file). However I would eventually like to get it so that it is using the content resolver (as explained here: https://developer.android.com/training/data-storage/shared/media) to access the shared media resources.
 
So is this sort of functionality possible with Cerberus (access to the MediaPlayer database)? And if so is it documented anywhere?
No, not out of the box. But with an external function, I can't see why not.

Alternative option: Does Monkey/Cerberus have a code pass through pragma? Titanium has this where you can specify "target code" that is not translated, but merely copied in place to the target source file.
No, CX doesn't have that. If you need to use native code, create a native function and access it as an external function from CX.
The BRL modules are good examples on how to do this.

So your problem is to read the content of the mediaPlayer database or just the playback?
 
I think just reading the database, provided that once I get the info, I can do everything with it through the mojo.audio interface

No, not out of the box. But with an external function, I can't see why not.


No, CX doesn't have that. If you need to use native code, create a native function and access it as an external function from CX.
The BRL modules are good examples on how to do this.

So your problem is to read the content of the mediaPlayer database or just the playback?
 
Back
Top Bottom