[Alsaplayer-devel] libalsaplayer in LiVES
salsaman at xs4all.nl
salsaman at xs4all.nl
Mon Oct 3 05:39:44 BST 2005
> There are two ways of interacting with AlsaPlayer. One way is through
> libalsaplayer, and requires you to start alsaplayer as a separate
> process -- in your case probably using the daemon interface. The
> second way is by creating an interface plugin (but I think that would
> less appropriate for your case).
>
> You can take a look at my LIRC AlsaPlayer control program
> <http://www.uhoreg.ca/programming/ap-lirc.text> as an example of using
> libalsaplayer. Versions 0.3 and prior used libalsaplayer; versions
> 0.4 and later used an interface plugin. (You probably shouldn't use
> the "system" function to run alsaplayer like I did, though. Do a
> proper fork and exec instead.) Since you don't know if the user has
> an already-running alsaplayer session, and it would be rude to hijack
> their session, you should probably start alsaplayer with the --session
> and/or --session-name options, and use the ap_find_session(...) and/or
> ap_session_running(...) functions in libalsaplayer.
>
> By creating an interface plugin, you can integrate much more closely
> with AlsaPlayer, but in this case, AlsaPlayer runs as the main
> program, and your interface is loaded by AlsaPlayer, which is probably
> not what you want. However, this could be used to get around any
> limitations in libalsaplayer, by creating an interface plugin that
> just provides LiVES with a way of communicating with it. For example,
> I think it would be handy to have an XMPP/XML-RPC/SOAP/D-BUS/...
> interface plugin for AlsaPlayer. But this may be too much work than
> what you want.
Hi Hubert and others,
thanks for your suggestions. However, I have been investigating a bit more
and now I don't think libalsaplayer is suitable for my needs.
As far as I can see, it can only play files with a wav header, it seems to
not be able to play raw pcm.
What I would need is something like:
ap_add_file (0,"foo.raw");
ap_set_channels (0,2);
ap_set_rate (0,44100);
ap_set_sample_size (0, 16);
ap_set_signed (0,1);
ap_set_endianness (0,1);
ap_play (0);
etc.
I am thinking now I will implement my own player in alsa, this will also
be useful in the future when I come to implement the jack connection in
LiVES.
Once again, thanks for your help.
Gabriel/Salsaman.
More information about the alsaplayer-devel
mailing list