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...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice