Question

I am using QNX neutrino RTOS, I am new to QNX. I have setup my first project with some IPC messaging between two threads.

What I want to do is have one thread as a microphone "driver" that samples input from the microphone and stores / sends it as PCM packets to another thread which plays it out of the speaker.

So, are there any audio support libraries?, what is the best way to achieve recording microphone input and speaker output?

Was it helpful?

Solution

Yes, QNX comes with an audio library.

The audio library is documented starting at this location (6.5 SP1 version): http://www.qnx.com/developers/docs/6.5.0_sp1/index.jsp?topic=%2Fcom.qnx.doc.neutrino_audio%2Fabout.html&cp=13_1

Your qnx system includes a utility (command) called "wave" for playing back a .wav file and "waverec" for recording audio from the microphone and saving it to a .wav file.

You can use the "use wave" and "use waverec" commands for getting information about the supported command line options.

The documentation includes the complete source of the wave and waverec utilities:

wave.c: http://www.qnx.com/developers/docs/6.5.0_sp1/index.jsp?topic=%2Fcom.qnx.doc.neutrino_audio%2Fwavec.html

waverec.c: http://www.qnx.com/developers/docs/6.5.0_sp1/index.jsp?topic=%2Fcom.qnx.doc.neutrino_audio%2Fwaverec.html

The recommended way to start with audio recording and playback is to first have the wave and waverec binaries shipped with the system working. After that build the supplied source, have it working again, then understand it and embed in your application, possibly after stripping it down. (Because the sample is generic and perhaps you want to hard-code certain features that are dynamically configured in the sample).

You need to link against the libasound.so library in order to build the samples. A minimal command-line example (tested) to build wave.c for armlev7 and x86:

ntoarmv7-gcc wave.c -o wave -l asound
ntox86-gcc wave.c -o wave -l asound

If you are building via the IDE then you need to add the library in the appropriate setting.

You are welcome to post here any questions you may have while working with the samples.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top