[CLAM] the object rightChannel is not ready

Daniel Casanovas i Torrents dani at sms25.com
Fri Nov 28 17:03:52 PST 2003


Hi all,

First of all I'd like to thank to all the people who are helping me.

I'm now working on the playback part of my aplication. In order to do that, I've looked at the Playback example.
In my aplication the incoming Audio is mAudioIn.

But when my aplic. is running CLAM says "ASSERTION FAILED". As it says, when I do the Start() the Object is not ready. Deploying I've found that the Object is rightchannel.

Do I need some command I've forgotten??
Here goes my code...

  CLAM::TSize nSamples = mAudioIn.Size();
  CLAM::TData sampleRate = mAudioIn.SampleRate();

  CLAM::Audio   signalLeftChannel;
  CLAM::Audio   signalRightChannel;
  
  signalLeftChannel.SetSize( nSamples );
  signalLeftChannel.SetSampleRate( sampleRate );

  cout<<"mono\n";

  if ( mAudioIn.Channels() == 2 )
  {
   cout<<"stereo\n";
   signalRightChannel.SetSize( nSamples );
   signalRightChannel.SetSampleRate( sampleRate );
  }
  else if ( mAudioIn.Channels() > 2 )
  {
   std::cerr << "Only stereo or mono files playback is supported! " << std::endl;
   exit(-1);
  }
  
  mAudioIn.Start();      

  if ( mAudioIn.Channels() == 1 )
   mAudioIn.Do( signalLeftChannel );
  else if ( mAudioIn.Channels() == 2 )
   mAudioIn.Do( signalLeftChannel, signalRightChannel );
  
  mAudioIn.Stop();
  
   const CLAM::TData playbackSampleRate = 44100;
  const CLAM::TSize frameSize = 1024;

  CLAM::AudioManager theAudioManager( playbackSampleRate, frameSize );
  theAudioManager.Start();

  CLAM::AudioOut leftChannel;
  CLAM::AudioOut rightChannel;
  CLAM::AudioIOConfig  audioOutCfg;

  audioOutCfg.SetChannelID(0);
  leftChannel.Configure(audioOutCfg);
  audioOutCfg.SetChannelID(1);
  rightChannel.Configure(audioOutCfg);

  leftChannel.Start();
  rightChannel.Start(); CRASH!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-users-clam-project.org/attachments/20031129/48fdc365/attachment-0001.htm>


More information about the clam-users mailing list