Enku Wendwosen
Enku Wendwosen

Reputation: 1

J2ME - Fm recording app - can't buffer and write to a file

Hey every one I was developing a J2ME app that records fm radio,I have tried so many methods but I have failed. The major problem I faced is that in the media api for J2ME once the code for tuning into a specific fm channel is written(and works but only outputs directly to the speaker) I couldn't find a way to buffer the output and write it into a file.Thanks in advance.

Upvotes: -1

Views: 151

Answers (1)

Mixaz
Mixaz

Reputation: 4178

I think it is not possible with MMAPI directly. I assume the fm radio streams via RTSP, and you can specify it as data source for MMAPI, but if you want to store the audio data, you need to fetch it in your own buffer instead, and then pass to MMAPI Player via InputStream.

In that way you will need to code your own handling for RTSP (or whatever your fm radio uses), and convert data into format acceptable by MMAPI Player via InputStream, for example audio/x-wav or audio/amr. If header of the format doesn't need to specify length of data, then you probably can 'stream' it via your buffer receiving data from RTSP source.

This is some kind of low level coding, I think it will be hard to implement in J2ME.

Upvotes: 0

Related Questions