How to include audio file in compiled code?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to include audio file in compiled code?

Ole.Kirkeby
This is probably not so much related to GStreamer but more about how to link resources into projects. I have a .wav file used as an alertsound in a Qt project, and I want to include it with the executable so that I don’t have to distribute it separately. There is a mechanism for doing this in the Qt Resource System, with an alias tag in the file attribute, but it doesn’t work, presumably because GStreamer bypasses the Qt framework when it sees filesrc in gst_parse_launch. More specifically, the code
 
pipeline = gst_parse_launch("filesrc location=alertsound1.wav ! wavparse ! autoaudiosink", &error);
 
always causes the file alertsound1.wav to be read from the working directory regardless of which alias I have set up for it.  I also tried fdsrc instead of filesrc but I couldn’t make that work either.
 
ole
 

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to include audio file in compiled code?

Stefan Sauer
On 09.08.2010 16:12, [hidden email] wrote:

> This is probably not so much related to GStreamer but more about how
> to link resources into projects. I have a .wav file used as an
> alertsound in a Qt project, and I want to include it with the
> executable so that I don’t have to distribute it separately. There is
> a mechanism for doing this in the Qt Resource System, with an alias
> tag in the file attribute, but it doesn’t work, presumably because
> GStreamer bypasses the Qt framework when it sees filesrc in
> gst_parse_launch. More specifically, the code
> pipeline = gst_parse_launch("filesrc location=alertsound1.wav !
> wavparse ! autoaudiosink", &error);
> always causes the file alertsound1.wav to be read from the working
> directory regardless of which alias I have set up for it.
Filesrc always reads from the filesystem. If you use fdsrc you could use
a pipe and cat the file from the ressource into it. If you can easily
access the binary data from the ressource, you might be able to push
this into appsrc and use that as a starting point of your pipe.

Stefan

> I also tried fdsrc instead of filesrc but I couldn’t make that work
> either.
> ole
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>  


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel