opening a new bluetooth serial port and transmitting sound

V8dodgeram318

New Member
Licensed User
Hi,
I am trying to open a port on a bluetooth enabled device to transmit sound to a bluetooth headset. I have read many of the posts concrning opening a port and transmitting text, but does anyone know how I can take one of the B4ppc examples that are on the forum, and change it to transmit sound instead of text? Any help will be greatly appreciated.
 

taximania

Well-Known Member
Licensed User
Longtime User
You don't need to make a connection with b4ppc to the headset.

Use BTio from here btIO - WM5 Tray Bluetooth Mode Switcher
Pair the headset with your device and select 'Audio2BT' in BTio's menu.
Any sounds played within your b4ppc app, eg sound("ding.wav")
will be played throught the Bluetooth headset.

Edit: Totally forgot this bit.

I don't 'think' you can do what you want from within b4ppc.
It is possibly, but not without a new library (.dll)

I've looked at writing a bluetooth dll for another reason. I gave up. It's very complex.
 
Last edited:

taximania

Well-Known Member
Licensed User
Longtime User
It is possibly, but not without a new library (.dll)

I got bored, no current project to work on. So I came back to this one.

I'd over looked the fact my headset doesn't make a noise if I receive a text message.
This is of no use to me, if I'm out of my taxi having a fag, I could be missing possible work.

I had a brainwave, considering my last post.
Use BTio.
If I get out of the car without taking my phone, use BTio's Audio2BT :sign0060: but I've found that my headset has constant 'white noise/hash, like turned on but with no sound'.
This sounds (hahaha, sorry:() like a waste of headset battery power.

So:

Here's what I found. BTAudioOn.exe and BTAudioOff.exe
With your headset paired and connected to your device . . . . .

You can use Shell("BTAudioOn.exe","") from within B4ppc to pass all audio the the headset :)

And Shell("BTAudioOff.exe","") to kill it.

Simples :sign0148: 'English joke, ish'

Using the Outlook.dll, I can Intercept an incoming sms, eg.

Sub Intercept_MessageReceived
Shell("BTAudioOn.exe","")
Sound("whatever.wav")
Shell("BTAudioOff.exe","")
End Sub

Sorted :icon_clap:

I'll post a few files tomorrow evening :)
I'm still trying to find the RegKeys that BTAudioxxx.exe use.
 

taximania

Well-Known Member
Licensed User
Longtime User
Update:

I've attached the BTAudio files, they're from the xda-developers forum.
I edited my SMS received tone and added a 1 second 'silence' to the start of it.
This gives the system time to pass the audio to the headset before any sound is actually heard.
The delay (sleep(5000)) is required, or the audio is switched off before the tone has finished playing.
Set BT to 1 when bluetooth is switched on, and 0 when off. Otherwise it displays an error messagebox.

Sub Intercept_MessageReceived
if BT = 1
Shell("BTAudioOn.exe","")
sleep(5000)
Shell("BTAudioOff.exe","")
End If
End Sub

Works for me. Just thought I'd share it :sign0155:
 

Attachments

  • btaudio.zip
    4.3 KB · Views: 160
Top