[gst-devel] Setting volume for playbin

Stefan Kost ensonic at hora-obscura.de
Mon Jul 28 16:59:42 CEST 2008


Akbar Basha schrieb:
> Sorry for the late reply as I was on vacation.
>  
> When i execute the following the code with volume as integer 
> values gives the warning message without the sound. When the volume is 
> either floating point or casting to double it plays perfectly.
>  
> g_object_set ( G_OBJECT(play), "volume", 10.0, NULL );
>
> It gives runtime error when  the volume type is unsigned int . Like 
> the following code
>
> unsigned int val = 8;
> g_object_set ( G_OBJECT(play), "volume", val, NULL );
>
> Where as in command line it works without any of the above hassles.,
>
What is the problem here. This is to be expected. If you run "gst-inpect 
playbin" and look for volume - it's double. g_object_set() is a varargs 
function and parameters have to be in the right format (and terminated 
with NULL). gst-launch is an entirely different thing. its a tool and it 
tries to be helpful.

Stefan



>  
>
> Thanks,
> Akbar
>
>  
> On 7/22/08, *Danilo Freire* <xharada at gmail.com 
> <mailto:xharada at gmail.com>> wrote:
>
>     thats weird,
>
>     The runtime error is because G_Obejct just check the property set
>     when it is set.
>
>     but the problem with the volume change, I have no glue. try to run
>     using:
>
>     gst_launch -v playbin uri=file:///somewhere volume=10.0
>
>     and look for some problem in the verbose messages. If necessary use:
>
>     GST_DEBUG=3 gst_launch playbin uri=file:///somewhere volume=10.0
>
>     []s
>
>
>     On Tue, Jul 22, 2008 at 6:03 AM, Ganesh Kundapur
>     <ganesh.kundapur at gmail.com <mailto:ganesh.kundapur at gmail.com>> wrote:
>
>         I used the below code to set the volume.
>           
>                 play = gst_element_factory_make ( "playbin", "play" );
>                 g_object_set ( G_OBJECT(play), "uri", argv[1], NULL );
>                 g_object_set ( G_OBJECT(play), "volume", 10.0, NULL );
>
>         I muted the volume by using the volume control and played the
>         audio file with volume range 1.0 and 10.0. I'm able to hear
>         the sound but couldnt
>         make out the difference between the range 1.0 and 10.0 as the
>         sound emitted for the range 1.0 and 10.0 seems to be same.
>
>         I raised the volume to the full by using volume control, i got
>         the same behavior as above. It seems for the volume range 1.0
>         and 10.0, sound
>         is same. I could make a slight difference for the range 0.1/0.2.
>
>           Moreover if i give the volume as int/unsigned int rather
>         than double as g_object_set ( G_OBJECT(play), "volume", 3,
>         NULL ); it throws a runtime error
>         (a.out:13506): GLib-GObject-WARNING **:
>         IA__g_object_set_valist: object class `GstPlayBin' has no
>         property named `\x81\xc3\xdb\xc4\u0003'.
>
>         Is there any way to get/set the balance level?
>
>         /Ganesh
>
>
>
>
>         On Mon, Jul 21, 2008 at 6:53 PM, Danilo Freire
>         <xharada at gmail.com <mailto:xharada at gmail.com>> wrote:
>
>             yes, it is possible,
>             could you paste the code in here?
>
>             On Mon, Jul 21, 2008 at 6:22 AM, Akbar Basha
>             <akbar.sdl at gmail.com <mailto:akbar.sdl at gmail.com>> wrote:
>              
>
>                 Hi,
>                  
>                 Is it possible to set the volume for Playbin element?
>                 When I try to set the volume , says GstPlayBin has no
>                 property named.
>                  
>                 Regards,
>                 Akbar
>
>                  
>                 -------------------------------------------------------------------------
>                 This SF.Net email is sponsored by the Moblin Your Move
>                 Developer's challenge
>                 Build the coolest Linux based applications with Moblin
>                 SDK & win great prizes
>                 Grand prize is a trip for two to an Open Source event
>                 anywhere in the world
>                 http://moblin-contest.org/redirect.php?banner_id=100&url=/
>                 <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>                 _______________________________________________
>                 gstreamer-devel mailing list
>                 gstreamer-devel at lists.sourceforge.net
>                 <mailto:gstreamer-devel at lists.sourceforge.net>
>                 https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
>
>             -- 
>             Danilo Freire
>             Laboratório de Sistemas Embarcados e Computação Pervasiva
>             Centro de Engenharia Elétrica e Informática - CEEI
>             Universidade Federal de Campina Grande - UFCG
>
>             -------------------------------------------------------------------------
>             This SF.Net email is sponsored by the Moblin Your Move
>             Developer's challenge
>             Build the coolest Linux based applications with Moblin SDK
>             & win great prizes
>             Grand prize is a trip for two to an Open Source event
>             anywhere in the world
>             http://moblin-contest.org/redirect.php?banner_id=100&url=/
>             <http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>             _______________________________________________
>             gstreamer-devel mailing list
>             gstreamer-devel at lists.sourceforge.net
>             <mailto:gstreamer-devel at lists.sourceforge.net>
>             https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>          
>
>
>
>
>     -- 
>     Danilo Freire
>     Laboratório de Sistemas Embarcados e Computação Pervasiva
>     Centro de Engenharia Elétrica e Informática - CEEI
>     Universidade Federal de Campina Grande - UFCG
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>   





More information about the gstreamer-devel mailing list