How to solve PVMFErrNotSupported error while playing sound

All your problems with Audio, Video and Images.

How to solve PVMFErrNotSupported error while playing sound

Postby prashantkspatil » Tue Aug 24, 2010 2:39 pm

Hello all

In my application I am sending notification to show it on notification bar it works perfectly.
But it gives me error while playing custom sound for notification.
I have tried saving mid file in application folder with an without extension and set its Uri for notification sound.
Code: Select all
notification.audioStreamType = AudioManager.STREAM_NOTIFICATION;
notification.sound = Uri.fromFile(new File("/data/data/../alert2"));


When notification send no sound played and I seen the error in Logcat as

08-24 18:16:29.260: ERROR/PlayerDriver(51): Command PLAYER_SET_DATA_SOURCE completed with an error or info PVMFErrNotSupported
08-24 18:16:29.260: ERROR/MediaPlayer(76): error (1, -4)
08-24 18:16:29.270: WARN/PlayerDriver(51): PVMFInfoErrorHandlingComplete
08-24 18:16:29.290: WARN/NotificationService(76): error loading sound for file:///data/data/../alert2
08-24 18:16:29.290: WARN/NotificationService(76): java.io.IOException: Prepare failed.: status=0x1
08-24 18:16:29.290: WARN/NotificationService(76): at android.media.MediaPlayer.prepare(Native Method)
08-24 18:16:29.290: WARN/NotificationService(76): at android.media.AsyncPlayer$Thread.run(AsyncPlayer.java:78)

While I make a MediaPlayer using resource file for playing it plays well.
While shows similar error if I create MediaPlayer using Uri.

How can I overcome to this problem? I want to set it to notification any how please help me.

Thanks
prashantkspatil
Junior Developer
Junior Developer
 
Posts: 12
Joined: Fri Mar 19, 2010 8:15 am
Location: Pune

Top

Re: How to solve PVMFErrNotSupported error while playing sou

Postby prashantkspatil » Thu Sep 02, 2010 1:11 pm

This problem may be because of notification can not access my application's internal folder.

I have solved this problem by implementing own ContentProvider for file sharing and
set the Uri of my Raw file to the notification.sound no need to copy these files in application folder.
prashantkspatil
Junior Developer
Junior Developer
 
Posts: 12
Joined: Fri Mar 19, 2010 8:15 am
Location: Pune

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 17 guests