[Gambas-user] Problem with MediaPipeline

vuott at tutanota.com vuott at tutanota.com
Sat Apr 15 00:21:02 CEST 2023


Well,
that command line in terminal didn't work, because my audio source name was wrong.
So I ran this command:
     ~$ pactl list sinksSearching between the lines, returned in the terminal, I found this information:
      Source monitor: alsa_output.pci-0000_00_14.2.analog-stereo.monitor

Entering that correct source name of my audio device in the line:
     src["device"] = "alsa_output.pci-0000_00_14.2.analog-stereo.monitor"your Gambas code worked for me.




14 apr 2023, 23:23 da user at lists.gambas-basic.org:

> Hello,
> using in terminal pipe with gst-launch-1.0, reported by you, it does "not" work for me.
>
>
>
>
> 14 apr 2023, 22:00 da claus.dietrich at freenet.de:
>
>>
>> Hi
>>
>>
>> I am trying to record audio from the pulse monitor device. The      GStreamer pipe
>>
>>
>> $ gst-launch-1.0 -v pulsesrc      device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" !      audio/x-raw,rate=44100,channels=2 ! lamemp3enc quality=0      target=bitrate bitrate=192 cbr=true ! id3v2mux ! filesink      location="/home/$USER/output.mp3"
>>
>>
>> works, but I failed to setup an equivalent as Gambas      MediaPipeline. The following code is causing an error in line      enc["target"] = bitrate and when I uncomment the line I get an      error "Cannot set status" at pl.play.
>>
>>
>>
>>
>> ' Gambas class file
>> Private pl As MediaPipeline
>> Private src As MediaControl
>> Private fmt As MediaControl
>> Private enc As MediaControl
>> Private met As MediaControl
>> Private snk As MediaControl
>>
>> Public Sub Form_Open()
>>
>>   pl = New MediaPipeline
>>   src = New MediaControl(pl, "pulsesrc")
>>   src["device"] =      "alsa_output.pci-0000_00_1b.0.analog-stereo.monitor"
>>   fmt = New MediaControl(pl, "audio/x-raw,rate=44100,channels=2")
>>   enc = New MediaControl(pl, "lamemp3enc")
>>   enc["quality"] = 0
>>   'enc["target"] = bitrate
>>   enc["bitrate"] = 192
>>   enc["cbr"] = True
>>   met = New MediaControl(pl, "id3v2mux")
>>   snk = New MediaControl(pl, "filesink")
>>   snk["location"] = "/home/$USER/output.mp3"
>>  
>>   src.LinkTo(fmt)
>>   fmt.LinkTo(enc)
>>   enc.LinkTo(met)
>>   met.LinkTo(snk)
>>  
>> End
>>
>> Public Sub Button1_Click()
>>
>>   pl.play
>>
>> End
>>
>>
>>
>>
>> Can someone help?
>>
>>
>> Best regards
>>
>>
>> Claus
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230415/95e28019/attachment.htm>


More information about the User mailing list