×

Discussion Board

Results 1 to 2 of 2

Thread: sound on 9210

  1. #1
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    sound on 9210

    Hi,

    Anyone can help me about playing a sound from a descriptor instead of playing a sound from a file.

    I try to use CMdaAudioPlayerUtility::NewDesPlayerL
    but it doesn't work.

    Thanks

    Posted by Dominique Dumont, ddumont@ubisoft.fr
    on January 31, 2002 at 10:29

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Posts
    2,426

    RE: sound on 9210

    Posted by Forum Nokia Developer Support, communicator.developer@nokia.com
    on January 31, 2002 at 16:02



    Hi,

    This should help you out,

    const TInt KSoundPreference = 0x80000001;
    const TInt KRTPlayerSoundPriority = 97;

    _LIT(KToneFile, "C:\\documents\\Tones\\somefile");
    TBufC<64> iToneFileName(KToneFile);

    RFile file;
    RFs fs;
    fs.Connect();
    User::LeaveIfError(file.Open(fs, KToneFile, EFileShareReadersOnly | EFileRead | EFileStream));
    TInt size;
    file.Size(size);
    HBufC8 toneData = HBufC8::NewL(size);
    TPtr8 des (toneData->Des());
    file.Read(des);
    file.Close();
    fs.Close();

    // get more information about this from
    // the sound example in NokiaEx path
    iMdaAudioPlayerUtility = CMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(toneData, *this, KRTPlayerSoundPriority, (TMdaPriorityPreference)KSoundPreference);

    Regards,
    FN Developer Support

Posting Permissions

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