×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Resume device audio

    Hi,

    In my app I have to play some music. After the music finishes, I have to resume back the music which was already getting played lets say Songs from native Music player. Problem is: I am unable to resume it.

    One of the approach I tried: I am checking currently running audio details using
    Code:
    string name = Microsoft.Xna.Framework.Media.MediaPlayer.Queue.ActiveSong.Name;
    Scenario is like:
    1) I am playing music from phone, check its details via above code and in result I can check the correct active song name being played.
    2) Playing music, started music from my app, when it finishes I am again checking result of above mentioned code and its giving me error (Permission denied). As per system, no song was getting played.

    My thoughts: Rather than PAUSING the Nokia music file (just before playing music form the app), system is STOPPING it.

    Any idea on how to resume audio which was previously being played?

    Thanks

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2013
    Location
    Dublin, Ireland
    Posts
    564

    Re: Resume device audio

    Are you using the BackgroundAudioPlayer?

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Resume device audio

    Quote Originally Posted by theothernt View Post
    Are you using the BackgroundAudioPlayer?
    No. So far.
    Using MediaElement

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Resume device audio

    Anyone can help?

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2011
    Location
    Portugal
    Posts
    957

    Re: Resume device audio

    Hi Pooja,

    As far as I know all you can do is to Pause and Resume the music that its playing.

    If you do something like this:

    Code:
    Microsoft.Xna.Framework.Media.MediaPlayer.Pause()
    It will pause the current musing being played.

    If you do this:

    Code:
    Microsoft.Xna.Framework.Media.MediaPlayer.Resume()
    It will resume the music that was playing. You still need to check if something is playing and save a state to issue the resume instruction only if there is anything to be resumed.

    Also take in consideration that if I recall correctly you need to ask user permission before pausing the music, as per rules of submission to the store. If in testing they see that you pause a music that its playing without asking authorization to do so, your app may fail the certification process.

    Hope that helps you.

  6. #6
    Nokia Developer Champion
    Join Date
    Sep 2012
    Location
    Morocco
    Posts
    297

    Re: Resume device audio

    hi Pooja,

    I guess there is only one song in the queue, there is normally IsRepeating property in the MediaPlayer, you can set it to true, so it resumes automatically the music
    You also have MovePrevious() method.
    or simply you can take the last music in the Queue.

    PS: I didn't try these suggestions.

Similar Threads

  1. Audio Device in use - how to check it ?
    By sirtomash in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2008-08-04, 09:29
  2. CMdaAudioPlayerUtility Audio Resume KErrrAccessDenied
    By ronak in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2008-02-20, 11:12
  3. Is there other way get the device audio capability?
    By steveyzhang in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-03-15, 01:07
  4. Audio device
    By GiantSteps in forum Symbian
    Replies: 2
    Last Post: 2003-04-03, 06:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×