[CLAM] Question regarding CLAM::Audio::GetEndTime()

Xavier Amatriain xamat at iua.upf.edu
Fri Feb 2 00:05:18 PST 2007


That is weird indeed but I can't see the bug by looking at the code. It 
is clear that BeginTime is set incorrectly for the first audio. Can you 
print both GetSize() and GetBeginTime() for all chunks?

Bad Data wrote:
> I've starting to work with CLAM and have come across something that I 
> don't understand. I started with the FilePlayback_example.cxx to get a 
> basic idea how Audio is worked with. I changed the main loop of the 
> program around to see what can be done with the Audio class, during 
> one such test I did the following:
>
>                 while( reader.Do( incomingAudioChannels ) )
>                 {
>                   count += incomingAudioChannels[0].GetSize();
>                   time += incomingAudioChannels[0].GetDuration();
>                  
>                   for ( int i = 0; i < audioOutputs.Size(); i++ ){
>                     audioOutputs[i].Do( incomingAudioChannels[i] );
>                   }
>                   std::cout << "Durr: " << 
> incomingAudioChannels[0].GetEndTime() << "\n"; // I added this line.
>                 }
>
>
> when I compile and run this program the first few lines output to 
> stdout are:
> audioMixer examples # ./FilePlayback_example blue_serge.wav
> Durr: 23.22
> Durr: 23.2432
> Durr: 23.2664
> Durr: 23.2896
> Durr: 23.3128
> Durr: 23.3361
> Durr: 23.3593
>
>
> Shouldn't the first line be 0.002322 and aren't the subsequent lines 
> off by 23.22?
> It's my understanding that GetEndTime() returns the end time of the 
> audio in ms, and that the first chunk is only 1024 samples long. Am I 
> misunderstanding the correct use?
>
>
> James
>
>
>
>
> ------------------------------------------------------------------------
> Get your own web address. 
> <http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL>
> Have a HUGE year through Yahoo! Small Business. 
> <http://us.rd.yahoo.com/evt=49678/*http://smallbusiness.yahoo.com/domains/?p=BESTDEAL> 
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> CLAM mailing list
> CLAM at iua.upf.es
> http://www.iua.upf.es/mtg/clam





More information about the clam-users mailing list