[Clam-devel] problem with multiChannelAudioFileWriter

globot gglobot at gmail.com
Sun Mar 30 21:41:10 PDT 2008


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 ?






More information about the clam-devel mailing list