[Gambas-user] Problem with MediaPipeline

vuott at tutanota.com vuott at tutanota.com
Sat Apr 15 01:08:52 CEST 2023


For me this line works too:

     src["device"] = "alsa_input.pci-0000_00_14.2.analog-stereo"


TO NOTICE here:  
     "alsa_input......analog-stereo"                   (from INPUT)

Instead in the previous information:
     "alsa_output........monitor"                         (from OUTPUT)




15 apr 2023, 00:22 da user at lists.gambas-basic.org:

> Well,
> that command line in terminal didn't work, because my audio source name was wrong.
> So I ran this command:
>      ~$ pactl list sinks
> Searching 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/e6314d79/attachment-0001.htm>


More information about the User mailing list