[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 17:07:47 CET 2024


Le 17/01/2024 à 15:54, Claus Dietrich a écrit :
> Am 17.01.24 um 13:09 schrieb vuott--- via User:
>> Well, with a CLI-program the created file is not empty, only if the 
>> "MediaPipeline" instance variable is "global" (as Claus had already 
>> pointed out). In that case, however, I found that in order to make the 
>> program terminate, it is necessary to impose the "Quit" function.
>>
>> Instead, if this variable is "local," an empty audio file is 
>> generated. I had known about this problem for a long time, and to 
>> solve it, I adopted the temporary support file stratagem. If the 
>> variable is "local," the program ends regularly.
>>
> I cannot confirm, that a local declarations of the MediaPipeline or any 
> other MediaControl makes a difference (V3.18.4). I tested it with the 
> given example and the result was exactly the same. I am assuming that a 
> Quit command is equal to a click on the stop button of the IDE which 
> also preserves the contents of the mp3 file. I informed Benoît about 
> that in an email which I sent mistakenly to his personal account - my 
> apologies.
> 
> I just tried to run the given example as a non-GUI-application and can 
> confirm that the mp3 file is not emptied when doing this:
> 
> ...
> 
>      pl.play
>      Wait 20
>      pl.Stop
>      pl.close
> 
> This also worked with the GUI-application, but when I closed the FMain 
> (without any further command) the mp3 file was empty again. Does FMain 
> act as a media container which fills the mp3 file and kills its content 
> when being closed?
> 
> When the non-GUI application is brutally terminated by clicking on the 
> stop button of the IDE or by imposing a Quit command the contents of the 
> mp3 file is also preserved. But the same happens with the GUI version.
> 
> Best regards
> 
> Claus
> 

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

-- 
Benoît Minisini.



More information about the User mailing list