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

Developer

Forums

Forums:

Hi,

I have a problem getting sampling rate on the devices.

I am playing 22kHz PCM through IMedia. But when the device plays the sound, the device doesn't really play at 22kHz. In the other words, the bit rate does not equal to 22k x 16 bits per second.

For example, on Moto V9m, the bit rate is almost the same as 22k x 16 bits per second.
However, on LG VX8700, the bit rate is about 21.7k x 16 bits per second. This could result in a bug in my program.

Both devices use the same chipset, and have the same BREW version. Does anyone have idea to get the bit rate before the playback starts or early after the playback starts?

PS. the bit rate listed above were calculated from the total data size / total playback time.

IMEDIA_Play: [MM_STATUS_MEDIA_SPEC] gives the media specifications. AEEMediaNotify::pData points to the media specifications, which depends on the type of media. For example, for MP3, AEEMediaNotify::pData points to AEEMediaMP3Spec structure that contains the MP3 media specifications. See API reference for details.
Thnx,
Atul

IMEDIA_Play: [MM_STATUS_MEDIA_SPEC] gives the media specifications. AEEMediaNotify::pData points to the media specifications, which depends on the type of media. For example, for MP3, AEEMediaNotify::pData points to AEEMediaMP3Spec structure that contains the MP3 media specifications. See API reference for details.
Thnx,
Atul

Thank you for your reply. But I think you misunderstand my case. My problem is not that I could not get the sampling rate of the media. In fact, I always know the sampling rate, and I must set it myself.
The problem is that the hardware doesn't consume the audio data at the sampling rate. That is, the playback speed is actually a little bit different to the sampling rate. For example, if the bit rate is 21.65k x 16 bits, and the media sampling rate is actually 22kHz, then the playback speed is a little bit slower. Here, I have a bug in synchronizing the audio and the graphics. If the sound is long, the difference between the audio and graphics will increase.

Thank you for your reply. But I think you misunderstand my case. My problem is not that I could not get the sampling rate of the media. In fact, I always know the sampling rate, and I must set it myself.
The problem is that the hardware doesn't consume the audio data at the sampling rate. That is, the playback speed is actually a little bit different to the sampling rate. For example, if the bit rate is 21.65k x 16 bits, and the media sampling rate is actually 22kHz, then the playback speed is a little bit slower. Here, I have a bug in synchronizing the audio and the graphics. If the sound is long, the difference between the audio and graphics will increase.