[Gambas-user] gb.media - audio recording file is emptied when ending the program

Claus Dietrich claus.dietrich at freenet.de
Wed Jan 17 21:18:44 CET 2024


Am 17.01.24 um 17:07 schrieb Benoît Minisini:
> I have the same behaviour. When Form_Close() terminates (and so 
> pl.Stop and pl.Close), the file is there. It is emptied a bit later, 
> between the end of Form_Close() and the end of the program!
>
> At the moment I have no explanation of this poltergeist behaviour. 8-o

I just found something interesting. I shifted the code to a module, 
started the pipeline and stopped recording with

   Module1.pl.Stop
   Module1.pl.close

In that moment the mp3 file was still Ok. When I closed FMain, the same 
happened as before (empty mp3 file).

But then I stopped the recording with this

   Module1.pl.Stop
   Module1.pl.close
   Module1.snk2["location"] = Null

and closed FMain after that, the contents of the mp3 file was not 
emptied (!).

So it seems that property "location" of the filesink element is 
destroyed together with the element. I have no clue whether this is a 
correct view and legal approach but at least it is doing what we need.

It must further be noted that this happens with any audio-recording 
pipeline. There is no dependency on elements like tee, queue or 
encoders. Also the sound source and LinkTo resp. LinkLaterTo methods 
have no impact on this.

Regards

Claus






More information about the User mailing list