[Gambas-user] media component syntax and the gstreamer filesink
Dominique Michel
dominique.michel at ...3298...
Fri Feb 14 23:42:51 CET 2014
Le Fri, 14 Feb 2014 19:37:53 +0100,
Fabien Bodard <gambas.fr at ...626...> a écrit :
> and ? it's?
It's to add
$hOutput["location"] = "wavegenerator.flac"
$hPlayer = New MediaPipeline
$hAudio = New MediaControl($hPlayer, "audiotestsrc")
$hConv = New MediaControl($hPlayer, "flacenc")
$hOutput = New MediaControl($hPlayer, "filesink"])
$hOutput["location"] = "wavegenerator.flac"
' Set the pipeline
$hAudio.LinkTo($hConv)
$hConv.LinkTo($hOutput)
But I get another issue now. MediaPipeline have 4 methods: Play, Pause,
Stop and Quit.
Play is used to start the playing, and when I click on
the Play button, I get the file.
When I click on the Play button a second time, GStreamer pause and the
file is still here and I can play it with mplayer and alsaplayer. aplay
play it but give garbage at the output. mplayer sound is the best, but
it never stop the playing. Alsaplayer sound is a little bit choppy and
the duration display is lost.
And when I quit the wavegenerator, the file is still here, but its
content is erased and give a 0 bit file. I googled a lot, but didn't
find nothing that helped.
In the play/pause function, I try to replace
$hPlayer.Pause
by
$hPlayer.Stop
but the issue remain the same.
When quitting, $hPlayer.Quit is called, and that's what reinitialize the
file to a 0 length file. Another issue is it look like to be no
duration information in the file before its reinitialization to 0.
I googled a lot, but didn't find nothing that helped.
Dominique
>
> 2014-02-14 16:33 GMT+01:00 Dominique Michel
> <dominique.michel at ...3298...>:
> > Le Fri, 14 Feb 2014 11:51:08 +0100,
> > Dominique Michel <dominique.michel at ...3298...> a écrit :
> >
> >> I am adding a preference system to the WaveGenerator for the audio
> >> sink. It work for all sinks I try but one, the filesink.
> >>
> >> It is something like
> >>
> >> $hPlayer = New MediaPipeline
> >> $hAudio = New MediaControl($hPlayer, "audiotestsrc")
> >> $hConv = New MediaControl($hPlayer, "audioconvert")
> >> ' Set the output sink
> >> $hOutput = New MediaControl($hPlayer, Settings["OutputSink",
> >> "autoaudiosink"])
> >> ' Set the pipeline
> >> $hAudio.LinkTo($hConv)
> >> $hConv.LinkTo($hOutput)
> >>
> >> When the output sink is filesink, the preference key look like
> >> OutputSink="filesink location=/home/dom/wavegenerator.ogg"
> >>
> >> And when running it, it fail with
> >> Unable to create mediacontrol dans FMain:50
> >>
> >> which is
> >> $hOutput = New MediaControl($hPlayer, Settings["OutputSink",
> >> "autoaudiosink"])
> >>
> >> I try without the location=.., or without the path with just
> >> location=wavegenerator.ogg, and get the same result.
> >>
> >> Is it something I can do to get this to work?
> >
> > Never mind, I find it.
> >
> >>
> >> Dominique
> >>
> >> ------------------------------------------------------------------------------
> >> Android apps run on BlackBerry 10
> >> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> >> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> >> Get your Android app in front of a whole new audience. Start now.
> >> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Gambas-user mailing list
> >> Gambas-user at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> > ------------------------------------------------------------------------------
> > Android apps run on BlackBerry 10
> > Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> > Now with support for Jelly Bean, Bluetooth, Mapview and more.
> > Get your Android app in front of a whole new audience. Start now.
> > http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>
More information about the User
mailing list