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

Benoît Minisini benoit.minisini at gambas-basic.org
Wed Jan 17 22:30:43 CET 2024


Le 17/01/2024 à 21:18, Claus Dietrich a écrit :
> 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
> 

It seems that the filesink element restarts recording on its own, and so 
  by clearing the location, you prevent it from doing that.

But why does it happen only with GUI, i.e. with a GUI event loop and not 
the default interpreter event loop?

-- 
Benoît Minisini.



More information about the User mailing list