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

Bad Data djr4g3 at yahoo.com
Fri Feb 2 00:15:59 PST 2007


This is what I'm doing for every chunk:
                  std::cout << "EndTime: " << incomingAudioChannels[0].GetEndTime() 
                            << " Size: " << incomingAudioChannels[0].GetSize()
                            << " BeginTime " << incomingAudioChannels[0].GetBeginTime()
                            << "\n";


And this is what it is outputing:

audioMixer examples # ./FilePlayback_example blue_serge.wav 
EndTime: 23.22 Size: 1024 BeginTime 0
EndTime: 23.2432 Size: 1024 BeginTime 0.02322
EndTime: 23.2664 Size: 1024 BeginTime 0.0464399
EndTime: 23.2896 Size: 1024 BeginTime 0.0696599


James


Xavier Amatriain <xamat at iua.upf.edu> wrote: 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. 
> 
> Have a HUGE year through Yahoo! Small Business. 
>  
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> CLAM mailing list
> CLAM at iua.upf.es
> http://www.iua.upf.es/mtg/clam



 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20070202/7c4cb9d5/attachment.html>


More information about the clam-users mailing list