Console based audio player - controllable via stdinput
Hello,
i need a small console application (with source), and i will pay 75$ for that via paypal - or make a suggestion - please simply contact me via private message.
A) It needs to be a (simple) native console application (written in c/c++), thats permamently reads the stdinput. When it read this line:
"play:<path to song.wav>\n", it should play the given wav file.
B) "stop\n" should stop the song.
C) Caching the wav-file in memory. I never play more than 5 songs, so dont worry about memory usage.
D) I't not wished, that the console application runs another process like aplay or paplay.
E) When new song should played, while another song is beeing playing, it should be stopped (no fading out requied).
F) You can use pulseaudio or alsa. When using alsa, you need to keep the device open! This means: On start of the application, grap directly the audio device,and never close it. Otherweise i will hear a bad noice at the begin and end of every song. In pulseaudio, it not requied, because i can disable the "idle-mode".
Why i need this:
I have a C# application (chess application) on a ARM board. When using aplay, i hear a noise at the start and end of every song (when grapping/ungrapping the audio device). This is a problem of hardware. When using pulse audio with disabled idle-mode, the audio device will be active all the time, no noise is there, when a song begins/ends.
The next problem is, when using paplay(or even aplay), it's too slow! I'm not very sure "why" it's too slow, but between the "play-trigger" and the read sound, there are 1-3 seconds. The ARM computer is slow, runs at 700Mhz and has a SDcard as storage (Rasphery PI, running Raspian, depian wheezy ARM-version).
So the console application needs to run all the time (my c# application will run it), and listen on the stdinput for "play:<song>\n" and "stop\n" commands. When becoming a "play"-command, it should play the song "instantly" (for the first time, when the wav-file is not cached, its ok, when its not "instantly"). So, calling a child application like aplay/paplay is not wished - my application would be able to do this at theiry own ;)
The song needs to be there "instantly", because it's a physical interaction, and it's not wished, that the sound will be there 1 s later started. It should be as fast as possible. The duration of the sound is round about 0.5-3 seconds (moving a pice on the board, "your turn", "thinking", "check", "check mate).
Please keep in mind: The ARM computer is slow.....every slow.
And why i don't do it directly in c#? Lack of libraries with .NET bindings, that offer a audio interface ;) Even with gstreamer, i have lots of problems. I tried to adapt some source snippets from Bansee.fm, but it's GUI-app, and on the other hand, they are using jackd (it seems), and for jackd, the memory is too less.
Another idea was to use other console based players, but they are opening/closing the device before/after every song - so i hear the noice. And i cannot send CTRL-keys via stdinput.
Feel free to aks questions.
Greetings,
Sebastian