Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi all,

I am working on IMedia, and when I am trying to get the duration of the file, using IMedia_GetTotalTime, it is returning 32 every time for files of different durations.

Due to this problem I am unable to synchronize the progress bar with the audio being played.

Also, I would like to ask how to convert the output of IMedia_GetTotalTime into minutes and seconds.

Any help would be appreciated.

Thanks,
Ambarish

When you say that IMedia_GetTotalTime is returning 32, do you mean the actual function call is returning that value? If so, please take a look at the documentation on IMedia_GetTotalTime, as I believe that you may not be using it correctly. IMedia_GetTotalTime returns the error code, not the media's length. It returns the media length through an MM_CMD_GETTOTALTIME event to the callback registered by IMedia_RegisterNotify. Also, error code 32 is EITEMBUSY, which from the BREW API Reference documentation, means "IMedia Interface is currently busy. Try after some time."

When you say that IMedia_GetTotalTime is returning 32, do you mean the actual function call is returning that value? If so, please take a look at the documentation on IMedia_GetTotalTime, as I believe that you may not be using it correctly. IMedia_GetTotalTime returns the error code, not the media's length. It returns the media length through an MM_CMD_GETTOTALTIME event to the callback registered by IMedia_RegisterNotify. Also, error code 32 is EITEMBUSY, which from the BREW API Reference documentation, means "IMedia Interface is currently busy. Try after some time."

Thanks greg.
I did exactly that yesterday. Unfortunately the control is never going to the
MM_CMD_GETTOTALTIME, in the registered callback. I know its an asynchronous call but unless I get the time, I am not able to synchronize the playback with my progress bar.
Regards,
Ambarish.

Thanks greg.
I did exactly that yesterday. Unfortunately the control is never going to the
MM_CMD_GETTOTALTIME, in the registered callback. I know its an asynchronous call but unless I get the time, I am not able to synchronize the playback with my progress bar.
Regards,
Ambarish.