[Clam-devel] problem with multiChannelAudioFileWriter

David García Garzón dgarcia at iua.upf.edu
Mon Mar 31 04:13:29 PDT 2008


On Dilluns 31 Març 2008, globot wrote:
> hi,
>
> 好久不见, long time not see :)
> recently I have seen a strange problem with the
> MulltyChannelAudioFileWriter, my old code for recording sound is simple
> and was working just fine for a while but since... I don'tt know when it
> don't work anymore and I can't record.
>
> what i do :
>  > cfg2.SetTargetFile( (const char *)file );
>  > cfg2.SetSampleRate(48000);
>  > cfg2.SetNChannels(2);
>  >
>  > writer = new CLAM::MultiChannelAudioFileWriter( cfg2 );
>  >
>  > network->AddProcessing("AudioFileWriter", writer);
>  > network->ConnectPorts("AudioMixer_AirL.Output Audio",
>
> "AudioFileWriter.Channel #0");
>
>  > network->ConnectPorts("AudioMixer_AirR.Output Audio",
>
> "AudioFileWriter.Channel #1");
>
>  > network->Start();
>
> I always get an error of type :
>  > ##########################################################
>  > ################### ASSERTION FAILED #####################
>  > ##########################################################
>  > At file scons/libs/audioio/src/PCMAudioStream.cxx line 99
>  > Cannot open file '/music/test/0_20080331_1154.aif' for writing!!!
>
> plus, if i look the MultiChannelAudioFileWriter configuration error i
> got a return false because => "No file selected"
>
>
> the problem is that before it was working just fine, the /music
> partition is mounted correctly with write permission, and if i load the
> network with NE, it work well.
> My code haven't change for months, the only tow think i did was, crypt
> the /music partition with a heavy encryption (but work well with NE) and
> commit the last CLAM svn version one week ago (from old svn 1.1.1)
>
> an other thing that trouble me a little is that if i want to reconfigure
> an existing multiChannelFileWriter object, I got a segfault with no
> assert. i try to do it on the reader and work well, but on the writer
>
> the fallowing code cause a crash :
>  > if (!network->ConfigureProcessing("AudioFileWriter", cfg2)) // <=
>
> segfault here
>
>  > {
>  > fprintf(stderr, "Error : can not configure AudioFileWriter\n");
>  > return;
>  > }
>
> I tried to revert CLAM to my old version, but there is no effect, still
> produce error.
> an other thing strange is that the header of the audio file is written
> (in my case aiff file header)
>
> do you have any clue ? I don't know exactly where to search, i think the
> write access is denied because the file might be locked, but why ?


This is my bad smell:

>  > cfg2.SetTargetFile( (const char *)file );

Why do you need to cast to const char *? What is 'file'?



-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080331/dcfd86ea/attachment-0003.pgp>


More information about the clam-devel mailing list