Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Sound in linux (Lack of standards in Linux is a problem but there are some near-standards)
Re: Sound in linux [message #44106 is a reply to message #44100] Thu, 25 December 2014 13:57 Go to previous messageGo to next message
rainbowsally is currently offline  rainbowsally
Messages: 29
Registered: December 2014
Promising Member
Hi Klugier and Mirek and Linux developers.

Klugier wrote on Wed, 24 December 2014 16:30
Hello Mirek,

Next problem is GCC warning, because we ignore system return value. What should we do?

int status = system(...)
if (status == -1) return; // <- Throw exception???


Sincerely,
Klugier


Klugier: No throwing an exception wouldn't be helpful. Just ignore the result. Warnings should be shown at compile time, if at all.

Mirek: also, note that the "question" for the question sound in the freedesktop files is window-question.* not dialog-question.* so the code posted here a while back, as written might not find the right file.

I may start checking this stuff out more dillegently in the future... Still figuring out how stuff works.

All: We don't want to hard-code something like ogg123 as the handler or even as a possible handler for the sound files if we plan to ever handle any other extension than .oga or .ogg because ogg123 only handles ogg.

We don't even want it to be an option because if we play something with some other extension it won't work at best and it might hang (zombie) or cause a horrible clicking white-noise racket by playing the wrong format.

This "racket" does happen with other players trying to play mp3s, not sure about ogg123.

Mirek: this brings us back to the serious problem of lack of standards in linux. "play" from the sox package handles practically every format except mp3. Or perhaps we need to develop our own sounds and the player for them. But then, of course, we have the fun task of detecting the system driver, of which there are currently about 5 non-standards to try to detect.

Sox (including which includes "/usr/bin/play") is indeed overkill, but it is very complete and already handles all this linux non-standards nonsense.

PS. Sorry if I misremember any of the names of the files or macros.
Re: Sound in linux [message #44109 is a reply to message #44106] Thu, 25 December 2014 14:23 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello rainbowsally,

Quote:

All: We don't want to hard-code something like ogg123 as the handler or even as a possible handler for the sound files if we plan to ever handle any other extension than .oga or .ogg because ogg123 only handles ogg.

We don't even want it to be an option because if we play something with some other extension it won't work at best and it might hang (zombie) or cause a horrible clicking white-noise racket by playing the wrong format.

This "racket" does happen with other players trying to play mp3s, not sure about ogg123.


ogg123 can detect that it cannot play .wav file. It not hangs and not produce noise (Checked by playing wav file). So, we can change the importance of players (* gst123 can handle all interesting formats):
const char *players[] = { "play", "gst123", "ogg123" };


Moreover, I would like to notice that having more trusted players in list we have more likely that someone has got this program.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Thu, 25 December 2014 14:26]

Report message to a moderator

Re: Sound in linux [message #44119 is a reply to message #44105] Thu, 25 December 2014 21:01 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
You are right.

Mirek
Previous Topic: Raster::Line segfaults ... sometimes.
Next Topic: Adding network proxy support to U++
Goto Forum:
  


Current Time: Fri Mar 29 00:29:53 CET 2024

Total time taken to generate the page: 0.01250 seconds