PDA

View Full Version : TreoSpeaker DAs


pruss
07-30-2008, 12:40 AM
http://www.1src.com/freeware/fileinfo.php?id=1865

This includes two DAs, FrontSpeaker and RearSpeaker, which switch non-phone audio to the Treo's front speaker or to the rear speaker / headphone, respectively. Why would you want to do that? Well, maybe you forgot your headphones, and you want to listen to an audio book in a crowded area. Then you can listen through the front speaker, looking and sounding as if you were having a phone conversation.

rossarnie
07-30-2008, 03:17 AM
Thanks Alex - this is very handy!

FranckW
07-30-2008, 03:22 AM
I will try...
I dreamt of it, Alex did it ! :)

Thanks a lot, Alex ! Really ! :)

pruss
07-30-2008, 05:49 PM
Very Nice and useful.

Another use, is it's an easy way to get APT to put the Treo into a near mute mode.

I've noticed it makes the Phone Ring Tone quiet, as it also then comes out of the front speaker.
- So that could be a useful way of making the ring tone quiet for a while.
- However it might also mean missing a phone call. I've tried to find a way for APT to trigger RearSpeaker on an incoming call, but have failed so far :confused:

This is interesting. Is this with the stock ring-tones or with mp3 ring-tones?

pruss
07-30-2008, 05:51 PM
I will try...
I dreamt of it, Alex did it ! :)

Thanks a lot, Alex ! Really ! :)

You're welcome. It was super-easy, apart from digging through header files. Here is the complete source code for FrontSpeaker:

#include <PalmOS.h>
#undef appCreator
#include "68k/Hs.h"

#define RESID 1000

void DA( void )
{
UInt16 libRef;

if ( errNone == SysLibLoad( hsSoundLibTypeID, hsSoundLibCreatorID, &libRef ) ) {
if ( errNone == HsSndOpen( libRef ) ) {
HsSndSwitchSetPort( libRef, hsSndSwitchID_InHostPlay, hsSndPortID_OutReceiver, hsSndPortClass_Real );
HsSndClose( libRef );
}
SysLibRemove( libRef );
}
}

pruss
07-31-2008, 12:27 AM
I added LoudToggle to the TreoSpeakers package. LoudToggle is a DA that toggles an extra-loud mode when playing app sounds out of the rear speaker.