[Gambas-user] play audio trough Jack audio server using ONLY gambas resources

Benoît Minisini gambas at ...1...
Fri Feb 3 09:57:55 CET 2017


Le 27/01/2017 à 14:23, Federico Allegretti a écrit :
> hello everybody.
> Trying to play audio files with GB.MEDIA and his jack audio sink plug in.
>
> I got gb.media returning media informations (like duration), but no
> playback after play.
>
> ' Gambas class file
>
> Private Player_A As MediaPlayer   'player che gestira' i media con gb.media
> (gstreamer)
> Private UscitaAudio As MediaControl 'l'area di rendering dei media
>
> ......
>
> Public Sub Button3_Click()
>   Player_A = New MediaPlayer As "MediaPlayer"
>   UscitaAudio = New MediaControl(Player_A, "jackaudiosink")
>
>   Player_A.URL = Media.URL(Label1.Text)
>   Player_A.Play
>
>   Timer1.Start
>
> End
>
> ......
>
> in patch bay i cannot see the gambas "client" creation nor cable connected,
> like i see if i run in the shell this command:
>
> gst-launch audiotestsrc ! jackaudiosink
>
> so i suppose i need a way to create the jack audio client, but cannot
> figure out the procedure.
>
> Thanks for the help.
>
> Federico
>

I think you must do:

Player_A = New MediaPlayer As "MediaPlayer"
UscitaAudio = New MediaControl(Player_A, "jackaudiosink")

Player_A.Audio.Output = UscitaAudio
Player_A.URL = Media.URL(Label1.Text)
Player_A.Play

Otherwise I don't think that MediaPlayer can guess what you want to do 
with your "jackaudiosink" automatically.

-- 
Benoît Minisini




More information about the User mailing list