How to Use - Rado-1/ZgeSL GitHub Wiki
- Open an ZGE project.
- Include
ZExternalLibrary
components for ZgeSL, MCI and CML to theOnLoaded
section ofZApplication
. All can be copied from the demos\player.zgeproj project. - Use the
musicInit
function to initialize the library. Usually it is placed to theOnLoaded
section. - Use the
musicExit
function to release allocated resources. Usually it is placed to theOnClose
section. - Play the music file or URI by
musicPlayFile
function, stop playing bymusicStop)
function. - Other functions can be used arbitrary to pause and resume playing (
musicPause
,musicResume
), set volume (musicSetVolume
), set panning (musicSetPanning
), get duration (musicGetDuration
), get playing status (musicGetStatus
), get playing position (musicGetPosition
), or set playing position (musicSetPosition
).
For examples of usage ZgeSL in ZGE projects, download the demo application from here.
Use the following file names in the musicPlayFile
call:
- if the
<file>
is included in the application's assets directory, use "<file>
", or - if the
<file>
is placed in a<directory>
on SDCARD, use "file://sdcard/<directory>/<file>
", or - if the file is opened from
<uri>
Internet address, use "<uri>
".
Just use one of the Project Windows building menu items.
- Compile your Android application, e.g., use Project / Android: Build APK (debug) menu item.
- Place libZgeSL.so file to the libs/armeabi folder. If the destination device supports the armv7a instruction set, it is recommended to use the library from armeabi-v7a folder. If not and you want to support wider range of devices, use the library from armeabi folder. They both work fine, but the version for armv7a achieves better performance.
- If you want to bundle mp3 file(s) to the built application, place them to the assets directory.
- Compile the APK again as in step 1.
- Deploy the APK file to your Android device and install it in a standard way.
Note 1: The 1st and 2nd steps are required only when the application is built the first time. After that, a single compilation produces correct APK.
Note 2: Use the step 2 also in the case when updating to a newer version of the ZgeSL library.