Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » [Debian, Ubuntu] Add "sox" package dependency
Re: [Debian, Ubuntu] Add "sox" package dependency [message #44233 is a reply to message #44232] |
Tue, 03 February 2015 06:32  |
|
Klugier wrote on Mon, 02 February 2015 21:38Quote:
By the way: I was looking at the sox package and noticed that it also provides library with C API. It should be possible to use the library directly, instead of calling the "play" in new process. It would be bit more work, but on the other hand, it could make a nice and universal sound package for U++. Probably much better than the one I created couple years ago using portaudio (which now rots in bazaar Smile ). If you're interested, nice example of playing sound with libsox can be found at github.
Sounds good, but LGPL license is not good (doesn't permit static linking). We should use something that posses more liberal license. For example PortAudio.
Hi Klugier,
As I mentioned in the paragraph you quote, I already tried with portaudio Didn't work very well... Portaudio is very low-level. You have to handle the buffers, select right hardware, set correct sampling and channels etc. Also, portaudio doesn't care about sound formats, you have to do the decoding yourself, or via another libraries.
Sox on the other hand can play many formats out of the box and the API is one level higher. Instead of saying "play this array of integers on /dev/snd", you can just programm it to "play this file on default sound output" That makes things a lot easier. I didn't check the license before, I'd probably hasitate about it being LGPL too... On linux/bsd it would probably be no problem to link it dynamically, but on windows it would probably mean we'd have to implement it some other way - which doesn't seem to be very good idea, unless it could be done directly via windows API.
From a quick search a better licensed option could be SFML, but it contains much more than just the sound handling. There is no need to pull another graphic library into U++ and I'm not sure if the only the sound part could be extracted...
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Tue Apr 29 00:29:13 CEST 2025
Total time taken to generate the page: 0.01032 seconds
|