[CLAM] doubt 44bytes

dani at sms25.com dani at sms25.com
Wed Nov 26 05:25:10 PST 2003


Thanks for the hint. Now i've declared only a global object called mAudio. But 
it doesn't works yet...

Quoting Xavi Rubio <xrubio at iua.upf.es>:

> 
> 
> This output is produced when you don't fill the audio passed to
> AudioFileOut with data, as is this case. You are executing
> mAudioOut.Do(mAudio), but you are hiding mAudio declaring a local variable
> with the same name.
> 
> Xavi
> 
> On Wed, 26 Nov 2003 12:47:26 +0100
> "Daniel Casanovas i Torrents" <dani at sms25.com> wrote:
> 
> > Hi,
> > 
> > I've got a problem with my LoadAudioFile and SaveAudioFile functions: it
> > always produces an output of... 44 bytes, so sthing is wrong. I send you
> > the actual code...
> > 
> > Audio mAudio;
> > 
> > MyCLAMApp::MyCLAMApp()
> > {
> > 
> > }
> > 
> > MyCLAMApp::~MyCLAMApp()
> > {
> > 
> > }
> > 
> > /////////////////////////////////////////////////////////////////////
> > /// Mètodes programa
> > ///////////////////////////////////////////////////////////////////
> > 
> > MyCLAMApp::Do()
> > {
> >  char fitxer_in[15];
> >  cout<<"\n>> MyCLAMApp.Do:: Introdueix el fitxer d'entrada: ";
> >  cin>>fitxer_in;
> > 
> >  LoadAudioFile(fitxer_in);
> > 
> >  SaveAudioFile("sortida.wav");
> >  cout<<"\n>> MyCLAMApp.Do:: Sortint - Fitxer carregat!\n";
> > }
> > 
> > 
> > bool MyCLAMApp::LoadAudioFile(char fitxer_in[15])
> > {
> >  AudioFileConfig afc;
> >  AudioFileIn mAudioIn;
> > 
> >  afc.SetName("FitxerIn");
> >  afc.SetFilename(fitxer_in);
> >  afc.SetFiletype(EAudioFileType::eWave);
> >  afc.SetSampleRate(22050);
> > 
> >  mAudioIn.Configure(afc);
> > 
> >  mAudioIn.Start();
> >  mAudioIn.Do(mAudio);
> >  mAudioIn.Stop();
> > 
> >  cout<<"\n>> LoadAudioFile :: File loaded";
> > 
> >  return true;
> > }
> > 
> > bool MyCLAMApp::SaveAudioFile(char fitxer_out[15])
> > {
> >  AudioFileConfig afc;
> >  AudioFileOut mAudioOut;
> >  Audio mAudio;
> > 
> >  afc.SetChannels(1);
> >  afc.SetName("FileOut");
> >  afc.SetFiletype(EAudioFileType::eWave);
> >  afc.SetFilename(fitxer_out);
> >  afc.SetSampleRate(22050);
> > 
> >  mAudioOut.Configure(afc);
> > 
> >  mAudioOut.Start();
> >  mAudioOut.Do(mAudio);
> >  mAudioOut.Stop();
> > 
> >  cout<<"\n>> SaveAudioFile :: File saved";
> > 
> >  return true;
> > }
> > 
> > thanks in advance
> > Daniel Casanovas
> > 
> > 
> 
> 
> 




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the clam-users mailing list