Android Programming Press on the image to return to the main documentation page.

ICOSMusicPlayer

Written by Giuseppe Salvi

List of types:

ICOSMusicPlayer

ICOSMusicPlayer


Events:

Complete

Members:


  ConvertTimeToMinuts As String

  ConvertTimeToSeconds As String

  Duration As Int  [read only]

  Get_Album_Artist As Int

  Get_Album_Title As Int

  Get_Artist_Name As Int

  Get_Author_Name As Int

  Get_Bitrate As Int

  Get_Cd_Track_Number As Int

  Get_Compilation As Int

  Get_Composer_Name As Int

  Get_Date As Int

  Get_Disc_Number As Int

  Get_Duration As Int

  Get_Genre As Int

  Get_Location As Int

  Get_Mimetype As Int

  Get_Number_Tracks As Int

  Get_Title As Int

  Get_Writter As Int

  Get_Year As Int

  Initialize (EventName As String)

  IsPlaying As Boolean

  Pause

  Play

  PlayMusicFromAsset (FileName As Stringtype As IntAs String

  PlayMusicFromFile (FileName As Stringtype As IntAs String

  PlayRingtone (type As Int)

  Position As Int

  Release

  setSetVolume (Left As Float, Right As Float)

  Stop

  Type_Alarm As Int

  Type_All As Int

  Type_Notification As Int

  Type_Ringtone As Int

  Version As Double  [read only]

Members description:

ConvertTimeToMinuts As String
Give you the real length in MM:SS
Example:
Sub Process_Globals
Dim timer1 As Timer
Dim mp As ICOSMusicPlayer
End Sub

Sub Globals
Dim label1 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
timer1.Initialize("timer1",1000)
timer1.Enabled=True
mp.Initialize
mp.PlayMusicFromFile("sdcard/media/1.mp3",0,True)
End Sub

Sub Activity_Resume
If mp.IsPlaying Then
mp.Play
timer1.Enabled = True
timer1_tick
End If
End Sub

Sub timer1_Tick
If mp.IsPlaying Then
Label1.text="Position: " & mp.ConvertTimeToMinuts & " - " & ConvertTimeToSeconds ( "Position: 3:28 - 0:00" )
End If
End Sub
ConvertTimeToSeconds As String
Give you the real length in MM:SS
Example:
Sub Process_Globals
Dim timer1 As Timer
Dim mp As ICOSMusicPlayer
End Sub

Sub Globals
Dim label1 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
timer1.Initialize("timer1",1000)
timer1.Enabled=True
mp.Initialize
mp.PlayMusicFromFile("sdcard/media/1.mp3",0,True)
End Sub

Sub Activity_Resume
If mp.IsPlaying Then
mp.Play
timer1.Enabled = True
timer1_tick
End If
End Sub

Sub timer1_Tick
If mp.IsPlaying Then
Label1.text="Position: " & mp.ConvertTimeToMinuts & " - " & ConvertTimeToSeconds ( "Position: 3:28 - 0:00" )
End If
End Sub
Duration As Int  [read only]
Return the total value of the loaded media in milliSeconds
Get_Album_Artist As Int
Get_Album_Title As Int
Get_Artist_Name As Int
Get_Author_Name As Int
Get_Bitrate As Int
Get_Cd_Track_Number As Int
Get_Compilation As Int
Get_Composer_Name As Int
Get_Date As Int
Get_Disc_Number As Int
Get_Duration As Int
Get_Genre As Int
Get_Location As Int
Get_Mimetype As Int
Get_Number_Tracks As Int
Get_Title As Int
Get_Writter As Int
Get_Year As Int
Initialize (EventName As String)
Initialize the Object.
You Should Initialize Before Load Any Sounds.
Example:
Dim mp as ICOSMusicPlayer
mp.Initialize("mp")
IsPlaying As Boolean
Return true if ICOSMusicPlayer is currently playig
Pause
Pause the current playback.
You can resume it from the current position
at any time by calling mp.Play
Play
Play or resume the media you loaded before
PlayMusicFromAsset (FileName As Stringtype As IntAs String
Load any media file and Play.
Example:
Dim Label1 as Label
Label1.Text = mp.PlayMusicFromFile("sdcard/media/somefile.mp3",mp.Get_Title)
or
mp.PlayMusicFromFile("somefile.mp3",0,True)
type is any information about any media file, type 0 = null.
PlayMusicFromFile (FileName As Stringtype As IntAs String
Load any media file and Play.
Example:
Dim Label1 as Label
Label1.Text = mp.PlayMusicFromFile("sdcard/media/somefile.mp3",mp.Get_Title)
or
mp.PlayMusicFromFile("sdcard/media/somefile.mp3",0,True)
type is any information about any media file, type 0 = null.
PlayRingtone (type As Int)
TYPE_RINGTONE
TYPE_NOTIFICATION
TYPE_ALARM
TYPE_ALL
Example:
mp.PlayRingtone(mp.Type_Ringtone)
Position As Int
Get Or Set The Current Position In MilliSeconds
Release
Release all resources
Allocated by ICOSMusicPlayer
setSetVolume (Left As Float, Right As Float)
Set the volume for each channell.
The value should be between 0 to 100.
Example:
mp.SetVolume(100,100)
Stop
Stop Playing.
You must load the media before to Play it again
Type_Alarm As Int
Type_All As Int
Type_Notification As Int
Type_Ringtone As Int
Version As Double  [read only]
Return the version of this library
Top