×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    136

    Problem to play song

    hi,

    i am using code of following link
    http://www.developer.nokia.com/Commu...ng_audio_files

    PlayUtility class
    i want to run song in background ...in fore ground i have password view which if i enter correct password song should get stopped...

    but whenn i try to do this
    first of all song is not geting played... even i am not able to enter password ...

    plz help me i am not able to resolve it...
    i know many time this topic is discussed but still i am not getting correct way to implement....

    Thanks in advance

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: Problem to play song

    Hope you are trying to play on a real device.. Firstly try to implement the sound play properly , forget about password screen.Put logs in various functions & see till what extent the code reaches.

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Problem to play song

    Basically you should debug and see what happens in there. And then have a separate threads here for separate problems, though you would need to check what the code does and does not do, and understand on what it is supposed to do, since you would actually need to explain the problem in a way that we could help on solving it.

  4. #4
    Registered User
    Join Date
    Nov 2011
    Posts
    136

    Re: Problem to play song

    it goes to Play function, MapcPlayComplete , but no song i am able to here... app is not getting crashed at that point ...

    app crashes at cacel of password dialog as ther i have not deleted object of player... as i want to stop playing at correct password only..

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Problem to play song

    How do you consturct the player, and start it ? Can you check both callback functions and see that no erros are reported in them, basically check the function arguments to see that there are no errors.

  6. #6
    Registered User
    Join Date
    Nov 2011
    Posts
    136

    Re: Problem to play song

    i have constructed using ..

    iPlayUtility = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this);

    started playing..



    void CPlayerUtility::MapcInitComplete(TInt aError,
    const TTimeIntervalMicroSeconds& /*aDuration*/)
    {

    if (aError == KErrNone)
    {
    iPrepared = ETrue;
    iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
    iPlayUtility->Play();
    }

    }

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Problem to play song

    that looks good, and if the MapcPlayComplete is called without error, it should indeed work just fine, thus I would not know any additional that could help on that then really.

    Anyway, make sure your sound file in long enough and see what gets reported in ReportStateAndTime.

  8. #8
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: Problem to play song

    Also make sure that the path of audio file which is passed is correct.

  9. #9
    Registered User
    Join Date
    Nov 2011
    Posts
    136

    Re: Problem to play song

    is there any specific path need to specify??

  10. #10
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: Problem to play song

    Quote Originally Posted by cholker View Post
    is there any specific path need to specify??
    No that is not required, just saying to check if the path where file is actually there is mentioned correctly in your code as well. Can you paste here the path which you are passing as aFileName

  11. #11
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Problem to play song

    if the path would be wrong, MapcInitComplete would be called with error, and thus play would be never called, and thus MapcPlayComplete would never be called either, thus if MapcPlayComplete is indeed called, then the play function is called, which would mean that MapcInitComplete was called without an error.. which indeed would indicate that filename is ok.

    So I would be interested on what I asked in #7

  12. #12
    Registered User
    Join Date
    Nov 2011
    Posts
    136

    Re: Problem to play song

    i was not checking for error in MapcPlayComplete..now when i have checked i am getting error code 50... not getting what it means

  13. #13
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Problem to play song

    Newer seen error code 50, you could see normal error list: http://www.developer.nokia.com/Commu...OS_Error_Codes

    So can you re-check what excat error code are you getting and also when ? Basically as you have timer, you could try f.ex. logging into a file and seeing whether the timer gets triggered before the error comes in.

  14. #14
    Registered User
    Join Date
    Nov 2011
    Posts
    136

    Re: Problem to play song

    i am getting KErrNotSupported but i am trying to play wav format .. it is supported na

  15. #15
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Problem to play song

    Basically you have something wrong with the format of the audio, thus you should find a file that is actually supported. You could try the device own player and see that it can play the file first, and then try it again in your app.

Similar Threads

  1. how can I play the song repeatly and stop playing the song?
    By vinnahang in forum Mobile Java General
    Replies: 5
    Last Post: 2012-03-23, 13:23
  2. how to display lyrics when play song?
    By gougou0601 in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2011-01-11, 16:51
  3. Play Next Song
    By nameispriya in forum Symbian
    Replies: 4
    Last Post: 2009-08-25, 09:49
  4. Play WM DRM song using CDRMHelper
    By vivekg79 in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2009-05-26, 07:39
  5. how can i play song a inbuilt ring within my application?
    By kalki in forum Mobile Java General
    Replies: 0
    Last Post: 2009-02-07, 04:38

Posting Permissions

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