Android JetPlayer – The Android system includes a JET engine that enables you to add interactive playback of JET music content in your applications. Android os provides Android JetPlayer class to take care of this stuff.
To be able to Jet Content , you should employ the JetCreator tool that is included with Android SDK. The use of jetCreator has been talked about in the example. To be able to play this content created by JetCreator, you will need android JetPlayer class reinforced by android.
To be able to use android JetPlayer , you will need to instantiate object of android JetPlayer class. Its syntax is listed below
JetPlayer jetPlayer = JetPlayer.getJetPlayer();
The next matter you must do is to call loadJetFile method and complete in the road of your Plane file. You then have to include this in to the Queue of Android JetPlayer. Its syntax is listed below
jetPlayer.loadJetFile("/sdcard/level1.jet"); byte segmentId = 0; // queue segment 5, repeat once, use General MIDI, transpose by -1 octave jetPlayer.queueJetSegment(5, -1, 1, -1, 0, segmentId++);
The technique queueJetSegment Queues the given section in the Plane Queue. The very last thing you will need to is to call the play method to start out participating in the music. Its syntax is listed below
From these methods apart, there are other methods described in the android JetPlayer class. They are identified below
Android JetPlayer Methods
- loadJetFile(String path)
Android JetPlayer Example
The next android jetplayer example demonstrates the utilization of JetCreator tool to set-up Plane content. Once that content is established, it could be enjoyed by you through JetPlayer.
To test out this android jetplayer example , you will need to perform this on a genuine device or within an emulator.
- You use Android studio room IDE to build an Android software and name it as JetPlayer under a program com.example.jetplayer.
- Install Python and WxPython on your pc from internet i will explain breifly.
- Run the JET creator from command line prompt
- Create JET content and then save it
- Run the application form and check the results
The first rung on the ladder that you’ll require when using JetCreator is to set up the python. The python can be installed from its standard website here or from anytime else on the internet.
Please retain in head the version volume of the python should either be 2.6 or 2.7 because this example practices that.
Once you down load python set it up. After setting up you have to create way to the python. Start your command fast and type the next command.It really is shown in the image below
Once path is defined , you can confirm it by keying in python and struck enter. It really is shown below
Do You Have Any Question About This Tutorial? Ask Question Now On Andro Development & Get Answer Instantly. No Signup/Login Needed
The next matter you must do is to set up the wxPython. It could be downloaded here. Once downloaded , you shall install it. It’ll be installed in the python website directory automatically.
The next matter you will need to is to go to the road where JetCreator exists. It really is in the various tools,SDK folder of the android os. It really is shown below
Once in this order be typed by the folder and struck enter.
It really is shown in the physique below
Once you strike enter, JET Inventor windowpane will open up. It might be something similar to this
Within the above Jet Windowpane, go through the import button. And choose JetCreator_demonstration_1 or 2 from the JetFolder from the demonstration content folder in the Plane folder. It really is shown in the image below
When you import the content , you will notice this content in the JetCreator windowpane. It really is shown below
You will explore different alternatives of JetCreator at the JetCreator website link here. To be able to create finally .jet file , you will need to save this content from the data file menu.
Once you have the jet data file, it could be enjoyed by you using plane player. The primary code of playing it’s been given below
JetPlayer jetPlayer = JetPlayer.getJetPlayer(); jetPlayer.loadJetFile("/sdcard/level1.jet"); byte segmentId = 0; // queue segment 5, repeat once, use General MIDI, transpose by -1 octave jetPlayer.queueJetSegment(5, -1, 1, -1, 0, segmentId++); jetPlayer.play();