Android Question Detect if music is playing

Discussion in 'Android Questions' started by trueboss323, Jul 24, 2015.

  1. trueboss323

    trueboss323 Active Member Licensed User

    Hi, is it possible to detect if a music is playing on the device?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use this code:
    Code:
    Sub IsStreamActive(Stream As Int) As Boolean
       
    Dim jo As JavaObject
       
    Return jo.InitializeStatic("android.media.AudioSystem").RunMethod("isStreamActive"Array(Stream, 0))
    End Sub
    Pass 3 for the music stream.
     
  3. trueboss323

    trueboss323 Active Member Licensed User

    Hi Erel,

    Thank you! I also have another question, can I also determine what title of the song is being played or the genre?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    There is no such feature in Android.
     
Loading...