×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    8

    CMdaAudioPlayerUtility PlayFileL failed to play file

    Hi all,

    Got a strange problem here.

    Trying to play a wave file upon certain event using CMdaAudioPlayerUtility::PlayFileL. Say the name of the sound file is test.wav. If I packaged the file under "C:\test.wav" and specified the filename constant as _LIT(KTestFile, "C:\\test.wav"), it works perfectly. If I substitute C drive with E drive and it also works perfectly. However, if i packaged the file under \resource\apps, and install the program under E drive instead of C drive, the sound no longer plays.

    The package file:
    "$(EPOCROOT)epoc32\winscw\c\test.wav" - "!:\resource\apps\test.wav"

    in source code cpp file:
    _LIT(KTestFile, "\\resource\\apps\\test.wav");

    I've checked that the file is where it should be using FExplorer. Does anyone know what went wrong?

    The reason that I am mocking around with the file location is because the program will be submitted to Symbian Signed and I am not sure if i can hardcoded the location of the file in C drive which may fail their test cases.

    Thanks.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,671

    Re: CMdaAudioPlayerUtility PlayFileL failed to play file

    You should specify a drive letter, but you can get it in runtime.
    For GUI apps:
    Code:
    _LIT(KTestFile, "\\resource\\apps\\test.wav");
    TFileName filename(KTestFile);
    CompleteWithAppPath(filename);
    for any app:
    Code:
    _LIT(KTestFile, "\\resource\\apps\\test.wav");
    TFileName filename(KTestFile);
    filename.Insert(0,RProcess().FileName().Left(2));

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    8

    Re: CMdaAudioPlayerUtility PlayFileL failed to play file

    Thanks. Much appreciated.

Similar Threads

  1. problem when importing from carbide c++ to vs 2003!
    By misfit.physics in forum Symbian Tools & SDKs
    Replies: 12
    Last Post: 2008-02-19, 09:45
  2. How to play forward locked(mp3) file
    By prasad4ever in forum OMA DM/DS/CP
    Replies: 7
    Last Post: 2007-05-23, 13:42
  3. cannot able to play a video file.
    By shalini.mishra in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2006-11-13, 16:54
  4. CMdaAudioPlayerUtility can not play AMR file.
    By khurshed79 in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-08-01, 09:39
  5. Replies: 1
    Last Post: 2005-05-26, 14:22

Posting Permissions

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