Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - audio: (5 Items)
   
audio  
I want to play a (simple) sound as an alarm (the buzzer is not loud enough).  I really don't want to code to do this.  
How do I make a big sound to wake me up?  I have looked at the audio docs and they all relate to creating an audio 
driver.  I want sound, not a project.

Thnx,

Terry
Re: audio  
Terry,

You could look at the "wave" example:
  
<http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.neutrino_audio/
wavec.html>

This example plays a .wav file (you may have a "wave" binary that matches
this source available) by parsing the header, setting up the output, and
streaming the PCM from the file to the output device.  If you saved your
sound(s) as wave files you could play them in the same way using this
example.

This is based on there being supported audio hardware, of course.  If you
have a playback entry in /dev/snd/ (ends with a 'p' character) then you
should be good to go.

-- 
Ryan J. Allen
QNX Software Systems



Re: audio  
Ryan,

Thanks.  A few questions.  There is no usage message.  How do I run the example?  How do I configure the audio system?  
Are there sample wav files available or do I need to fetch some from the web?  Is playing audio on the blackberry X in 
two/three months going to be this hard?

I have avoided audio on QNX for years as I did not want to be pulled into this particular swamp.  I thought it would 
become easier, but alas...

Terry
Re: audio  
Terry,

If you take a look at the wave.c example I linked there is an "#ifdef
__USAGE" section that shows the usage.  If you have a preferred playback
device (/dev/snd/pcmPreferredp) then I think you can get away with running
"wave /path/to/file.wav".  If you don't have a preferred output device you
can change the device with the "-a" argument.  If you "ls /dev/snd/"
you'll hopefully see "pcmC#D#p" devices, where the # characters are
replaced with the card and device numbers respectfully.

I do not think any sample wave files are shipped with Neutrino.  You'll
want to create your own custom wave files for your needs but you could
probably find examples online.  Note that .wav is strictly a container
format so it is possible that some wave files do not contain raw pcm data
(instead they might contain encoded data that requires software to decode
that data to pcm), though these types of files are not common.

BlackBerry 10 provides a framework on top of Neutrino that makes some
things easier.  Developers that are using the native NDK may still do
direct audio control using these low-level APIs.

A look through the QNX Audio Dev Guide may help.  Note that this is
different than the audio DDK, which may be what you were looking at
before.  The Audio Dev Guide will probably give you more information then
you ever wanted to know about playing audio but understanding it may go a
long way when you are trying to debug problems related to playback in the
future:
  
<http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.neutrino_audio/
about.html>

-- 
Ryan J. Allen
QNX Software Systems


Re: audio  
Thanks,

Terry