Forgot to ask... how is it that you are getting the length of these audio files?

Erick

On Mar 31, 2006, at 4:51 PM, Jeffrey Mattox wrote:

Summary:

The RB MoviePlayer appears to be using a sample rate of 43,892 kHz for mp3 files, instead of 44,100 kHz.


Details:

I am processing 53-minute mp3 files (podcasts) and, among other things, visualizing the waveform. To get the audio samples, I am using Dave Addey's code posted on the RB forums and here:

     http://tinyurl.com/pzlnt

I discovered a problem when trying to match the player position with the corresponding audio sample in the waveform.


Observations:

If I use Sound Studio to convert the file to AIFF, then everything is fine, and I get consistent readings from these various sources:

iTunes, Finder, QuickTime Player, Sound Studio, and my RB application:

    Length:       53:00 (mm:ss)
    Sample rate:  44,100 kHz
    Samples:      140,234,105


Mysteries:

1. If I use the original mp3 file, then the RB MoviePlayer reports the length as 53:15 (and it actually takes that long to play). QT Player and iTunes still report 53:00 when using the mp3.

2. The code referenced above thinks the sample rate is 44,100, but it generates 140,899,941 samples (at 44,100 that is 53:15) of which the last 665,836 samples are zero (a "tail"). Prior to the tail, there are 140,234,105 useful samples (same as the AIFF). Somehow, this code thinks the length is 53:15, too, even though it still uses 44,100 kHz for the valid samples.

So, it appears that the RB player is using a sample rate of 43,892 kHz. That accounts for the extra 15 seconds. I can correlate the RB position to the samples as follows:

    sample_index = MyMoviePlayer.Position * 43892

Can you offer any insights into these mysteries? And is there a way to fetch the sample rate being used by the MoviePlayer?

Jeff
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to