[android-developers] Re: Playing recorded sounds in Android 1.5

2009-07-09 Thread SonjaM
What you need to do is pass in a FileDescriptor to the setDataSource() method of MediaPlayer instead of a String file path. This is to avoid the permissions problems that Marco talks about earlier in the thread. String fileNameStr = getResources().getString(R.string.tmpfile); FileInputStream fis

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-06-25 Thread Ericase Jang
Hi, I got the same problem. Has anyone already solved it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsub

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-13 Thread Scott Slaugh
It's not an issue right now, but I decided it would probably be wiser to leave the file private in case it becomes an issue in the future, and changed my code to use a file descriptor. Thanks for your help! On May 13, 9:20 am, Marco Nelissen wrote: > That allows any other application to read or

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-13 Thread Marco Nelissen
That allows any other application to read or overwrite your file. Is that what you want? On Wed, May 13, 2009 at 8:06 AM, Scott Slaugh wrote: > > Here's what I ended up doing when I get the file, which allows me to > continue using the file like I was, but also sets the permissions > correctly

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-13 Thread Scott Slaugh
Here's what I ended up doing when I get the file, which allows me to continue using the file like I was, but also sets the permissions correctly without using a shell command. private File getAudioFile(String extension) throws IOException { String fileName = "recording" + extensi

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-12 Thread Dianne Hackborn
Note that launching shell commands is not a supported part of the SDK, and if you do this kind of thing you are opening your app to breaking in the future. On Mon, May 11, 2009 at 1:39 PM, Scott Slaugh wrote: > > I'm just using the built in MediaRecorder and MediaPlayer clases, so, > no I'm not

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-12 Thread Marco Nelissen
You can pass the path around all you want inside your app, but try using a FileDescriptor with MediaPlayer.setDataSource(). You won't have to change the permissions on the file that way (your app can still access the file however it wants, since it owns the file), but it will ensure there are no pe

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-11 Thread Scott Slaugh
Nobody else uses the recording, but I do have several other functions that use information that I can get from using a File object instead of a FileDescriptor, such as file size. On May 11, 3:16 pm, Marco Nelissen wrote: > Does anyone else besides you need to be able to play back the recording?

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-11 Thread Marco Nelissen
Does anyone else besides you need to be able to play back the recording? If not, try opening the file yourself and then passing its FileDescriptor to setDataSource(), instead of specifying the path. On Mon, May 11, 2009 at 1:39 PM, Scott Slaugh wrote: > > I'm just using the built in MediaRecord

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-11 Thread Scott Slaugh
I'm just using the built in MediaRecorder and MediaPlayer clases, so, no I'm not using alsa_sound. However, thanks to some help I was able to discover that the problem is being caused by the permissions set on the recorded file, which is not world-readable in Android 1.5. I was able to fix this

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-08 Thread p.rozas.larrao...@gmail.com
Hi, I've just registered the same problem trying to play a simple mp3 file. E/PlayerDriver (542 ): Command PLAYER_SET_DATA_SOURCE completed with an error or info E/MediaPlayer (770 ): PVMFErrNotSupported error (1, -4) I'm using the 1.5 sdk under windows xp and I've tried with some mp3 files fr

[android-developers] Re: Playing recorded sounds in Android 1.5

2009-05-07 Thread l hx
Do you using alsa_sound for recording & playback? On Fri, May 1, 2009 at 11:00 PM, Scott Slaugh wrote: > > Hi, > > I have an application that I developed using the Android 1.1 SDK that > I am trying to port to Android 1.5. In my application, I record a > sound through the microphone and then do