playing audio thru phone's speaker - Windows Mobile Development and Hacking General

greetinz,
Whether the subj. is possible on WM? I'm wondered if it is possible to make good VoIP-software that will output the audio not thru the external (loud) speaker (that plays music and ring sounds), but thru the phone's conventional voice-speaker. It's quite awkward to turn round the phone to make a call
p.s. i found that there's only one wave device, so the solution is somewhere else

i dont believe so i believe that the pda phones at least from htc
are a audioWise a pda and a phone in the same device with each their
output
which seem to be why people cant record phone conversation well or make auto answering machines

Related

Microphone Input Pass-Throgh & Uninterrupted Recording

Hi
I have two things I would like to do with my XDA 2 that I am currently finding I can't do:
1) Immediately output throught the speaker the live microphone input. I say this because I have an iPod and sometimes id rather use a speaker than earphones. Instead of carrying a set of portable speakers, the speaker on the XDA 2 would be most convenient if I could directly output an incoming audio signal. I have an adaptor so I can cleanly play through the music on the iPod and interferance would not be a problem.
2) Record sound clips either in wav or mp3 format as I currently do using Notes, but not have this intterupted by switching program or using the phone. I would like this simply to continue recording until it runs out of space or I return to the application and stop it. In addition a start/stop combination of the Notes button would be desirable say hold for 3 secs to start/stop rather than currently holding the button down for the entire duration of the recording or fiddling to tap the record button on the screen.
Im sure that both of the above are possible using some sort of software that I can download or buy. If anyone has any ideas id be very grateful.
Ash
Hey man,
You can't, because there's no full duplex sound driver in the mda
Else we would have an answering machine too
Hmm.. I have a problem, that I hear sound from microphone in the dinamic )
So maybee it is possible. But for me it is big problem, because i can't hear normal sound (played on phone, phone call, etc.).. only mic )
I've got it after installing BCHS bluetooth patch on my qtek 8310.
ps. Maybee somebody have registry dump from 8310, because I can't find what happened and how to return it back...

play sound through speaker and/or headset?

I want to be able to play sounds through the normal speaker, even though a headset is attached to the device (Blue Angel, in this case).
(The built-in telephone does this with its ring tones when a headset is attached.)
Only one WaveOut device is shown as present.
Anyone has a solution, or an idea?
nobody knows anything about this?
there's physical switch that disables the speaker after you plug in the earphones jack. its PHYSICAL, no amount of code will overcome this.
hey!!.. screw the last post. I managed to do what you wanted.
speaker + headset both rings, even when headset is connected... let me fix the code, then I will get back to you... ok
I'm waiting patiently!
Hi esbjorn,
din want to keep you waiting. but i think i finally found out exactly is going on.
there's only 1 device. however, the device enables both speaker and headset WHEN THERE'S AN INCOMING CALL, which you already know. Whether its hardware or software, I have yet to determine it.
I had a lot of code around and got confused. sorry if I gave you any false hope.
anyway, this is my hypothesis, windows has code to control only this 1 waveout device. when a call comes in, it decreases the volume of all sounds being played. it then plays the ringtone at a volume based on its registry. (try changing the attentuation in SoundCategories->Ring) it gives the effect (a loud ringtone and soft background audio) that there are actually 2 waveOut devices when there's only 1.
I will be working on it further, let me know if you make progress too.

Ringtone Problem- Plays out loud even when headphones are in

Anyone have a problem like this:
I did a had reset but it still is doing this-
The speaker plays my ringtones out loud even when my headphones are plugged in!!
Thanks,
Daniel
Mine has always been like that, whicever ROM I used.
Really????
My old XDA never did this...
So if i'm listening to music I run the risk of having my ringtone play out loud??
Is the only solution to change my ring prefrences to vibrate only when i'm listening to music (since the phone volume itself cannot be muted)??
When I preview the sound it doesnt play out loud
I don't have such problem with original headset. But, if I use bluetooth headset it happens.
So this is not normal....
How do I fix it?
I tried a hard reset- didn't work!!
Playing the ringtone out of the speaker even though the headphones are in is normal with most if not all phones. The headphones are only to listen to music and calls.
If you had the phones in but not in your ears and the phone rang only in the headphones how would you hear it?
Why would your headphones be plugged in if you are not listening to music?? And to answer your question- you would know the phone is riging by it vibrating.
Anyways- many people told me this is not normal...so there must be a way to change it.
Also, when I am in silent or vibrate mode and I accidentaly or even purposely push my Voice Command button the beep sound will come out of the speaker-
It will change the sound icon from Vibrate or Silent to the regular icon but will stay in silent/vibrate mode-
Is this normal??
-Daniel
Not sure about the voice command question but with regards "WHy would you have your headphones in if you're not listening to music" the answer is to use the phone handsfree.
Whether this is in the car (law over here) or while in the office a lot of people over here use headphones instead of holding the phone to your ear, some believe that the safer or healthier. No real proof but handsfree is popular.
Saw this same post on the Neonode forum and the SE's do the same so I presumed normal and as I say if you were using the headphones as handsfree if actually a good thing. Yes the vibrate would tell you but say you're at someone else's desk and can't hear the phone vibrating across your desk (hell of a vibrate really isn't it).
Anyway, hope that answers the headphones question
So why did some people say this doesn't happen to them?
That's an unanswerable question. It could be any number of reasons and going on the state of play with the ROMs is possibly down to this.
Going through the forums its amazing the number of people that have different problems with apparently the same phone.
I have the exact same problem, and am still looking for a solution.
The most irritating thing is that when I turn all ringtones off (only vibrate on) and I receive an incoming call, the sound that is currently playing (windows media player or some other program) is played for a fraction of a second thru the external speaker (the program pauses the mp3 playback on an incoming call, but this happens to late). Because of this it's impossible to use the phone for MP3 playback in a place where it's important that no sound is produced.
It would be really nice to completly turn the external speaker off when a headset is plugged in (i find it really strange this isn't the case right now).
It would be nice if someone found a solution for this (in my opionion) huge problem.
Yea,
I found this is irritating too,
I am using pocketMax Phonealarm
and mute:
- system volume
- phone volume
but max the call volume ( as I think that's required to answer a call)
I plugged my headset (using 2.5mm to 3.5mm jack) and listen the music using winamp & increase the volume, apparently the system volume is increased too ==> I think that's the reason why everytime:
- incoming phone call
- any reminder
is sounded in the headset too.... totally [email protected]@[email protected]#
Any solution for this????!!!!!

How to prevent OS from muting audio output when making a phone call

I'm working with an app running at Windows Mobile 5.0 pocket pc. And I
use 'waveout' functions to play some audio file, sometimes my app need
to automatically make some phone call using TAPI. Here comes the OS
behavior which I don't want: the audio output is somehow muted. I want
the audio output keeps the same volume, is there any way do it? Thanks
a lot!
When call is in progress, audio path is changed. This is a hardware feature (you can read about it in many posts about answering machines).
Currently there is nothing that can be done about this.
I had not actually tested this so I gave it a go. No sound gets through when I programmatically play a sound or when I use the media player. I belive Levnum is correct because when I play a sound and hang up the phone during the play back, the sound returns but is choppy for an instant. That would be caused by the path of the audio being switched. When i programatically change volume it is normally very clean, eg loud to soft but with not noise between.
a bit off topic...
One thing that bothers me about this isolation of the phone audio hardware is the presence of the GSM 6.0 input properties for the microphone. If the hardware is truly isolated from the system then why have this sampling format? Wouldn't the phone be doing its own sampling and not need windows to have this capablity?
What a bad news! Thank you anyway.
experimenting with the volume during a call
In June played a lot with audio levels on my hp h6315 while using TAPI and recorded my results. The 6315 isn’t an HTC device but I think it probably works similarly. I have a wizard too, but haven’t experimented as much with it.
Here are my notes that I typed when I did it:
(perhaps they will be useful to someone)
[size=+2] Playing wave stream while establishing a GSM call using built-in phone software[/size]
Inbound GSM call with ear bud (speaker and phone volume low setting)
Sound continues through ringing
Sound cuts out for ~1 second after selecting answer
Sound continues mixed with call
After call hang-up sound still continues
Inbound GSM call without ear bud (speaker and phone volume highest setting)
Sound switches to a lower setting (front speaker?)
After selecting answer, sound changes momentarily to high
Then Sound cuts out for ~1 second
Sound then resumes at lower level
If phone is put on speakerphone the sound goes to high level
Sound continues mixed with call
After call hang-up, with call on speakerphone, sound continues after a brief interruption
After call hang-up, sound reverts to loud and continues. There is a gap as in Speakerphone case, but it isn’t as noticeable since the change in volume helps to mask it.
Outbound GSM call with ear bud (speaker and phone volume low setting)
Sound is interrupted for about 1-2 seconds after hitting talk
Sound then continues through answer and hang-up. (mixed with call)
Outbound GSM call without ear bud (speaker and phone volume highest setting)
Sound is interrupted for about 1 seconds after hitting talk
Sound resumes at lower volume through call
Sound has brief interruption at hang-up while on speakerphone.
Sound reverts to higher volume after small gap at hang-up while not on speakerphone
[size=+2]Recording while establishing a GSM call using built-in phone software[/size]
Inbound GSM call with ear bud (mic on gain 5)
Recording continues through ringing
Slight break while answering then resume for brief time then changes to much lower gain.
Remains at lower gain
Inbound GSM call with ear bud (mic on gain 1)
Same as mic gain on 5, didn’t seem any quiter, also same with mic on AGC
OutBound GSM call with ear bud (mic on gain 5)
Slight break after pressing talk then resume for brief time then changes to much lower gain.
Remains at lower gain
Click to expand...
Click to collapse
I think my largest problem was the microphone gain, but I don’t remember for sure. On my typical volume settings, the cases where the volume level lowers, it often lowered so much that I couldn’t hear it without listening very carefully. Originally, I thought it was totally muted.
To help minimize the change in volume level, try adjusting the regular system volume to a relatively low level and put the phone volume on max. This helps some, but to fix the problem try multiplied the audio samples by 2 or more before playing them to the speaker. Find the best multiplication factor by trial and error.
Of course, your’s may be different.
For the off topic part, I thought the audio path for the microphone always was available to windows mobile and only the audio to the “telephone receiver” wasn’t.. There is only one microphone, but two speakers. The main system speaker is the one that you use to play wave files. The “telephone receiver” is the one that as far as I now is only used for telephone calls. I expect that this telephone receiver speaker is connected directly to the GSM chipset. I think when put on speaker phone the sound goes out through the main speaker. (I don’t have my phone with me so I can’t check right now)
Yes that is what I think as well. So if the phone "chip" is recording/playing the sound using the same hardware why dose windows need to be able to sample at that rate? Its the phone that needs to do the smapling.
The drivers on individual devices can vary a lot when it comes to sound. For example, on some of my devices playback will comence as soon as I add buffers that are appropriately prepared. This is not correct behaviour - the driver should wait for the waveOutWrite before it starts. On other devices the driver continues playing until a buffer is finished even if the waveOutReset is called. When it comes to setting the volume with waveOutSetVolume I have has more varying results on just about every device. Because of this I think it is not very usefull to spend a lot of time perfecting code for this sort of thing. Even if as a programmer you do everything correct its going to sound wrong somewhere.
If the phone can stream the call to and from a bluetooth headset then doesn't this mean the in call audio is accessible programmatically somehow?
Or am i missing something
Actually there was a theory floating around that if you could create a 'fake' / virtual BT driver you could capture and send sound from and to the phone.
As far as I know no one on this forum has done this.
It should be noted that some companies like gigabyte are producing phones with built in answering machines.
I think the hardware separation thing may just be an HTC thing and even then only for certain models.
reddreamster -
If you just want to play the audio to the user at the local end, and not down the phone line it is possible. As the others have said HTC keep the phone and local audio completely separate, so you can't play the audio down the phone.
Calling TerminateProcess to kill off cprog.exe can reduce the amount the system interferes in your TAPI calls ;-)
But to re-enable the local audio output this will probably not be enough. You need to call entry point 218 in \Windows\ossvcs.dll
This function takes 1 DWORD parameter, and you should pass the value 1.
I can't remember the return details, but it can be treated as a boolean:
if (return_code)
{ it succeeded }
Make this call AFTER you have made the TAPI connection, and it will re-enable the local audio output.
Hope that helps
Stuart
Solution
Microsoft published the anwser to this in Jan (2007). It's probably no longer of interest to reddreamster, but I thought I would publish a link to the answer in hopes that I might help the next person with the same question that manages to find this thread.
http://blogs.msdn.com/medmedia/archive/2007/01/04/the-wavedev2-gainclass-implementation.aspx
Also, you might be interested in this about the Mixers
http://blogs.msdn.com/medmedia/archive/2007/01/12/what-do-you-mean-by-mixer.aspx
Keywords that might have helped you find this:
mixer api mixerapi wave api waveapi tapi wavedev2 audio gain gainclass volume waveOutMessage waveOutSetVolume wave device
levenum said:
Actually there was a theory floating around that if you could create a 'fake' / virtual BT driver you could capture and send sound from and to the phone.
As far as I know no one on this forum has done this.
It should be noted that some companies like gigabyte are producing phones with built in answering machines.
I think the hardware separation thing may just be an HTC thing and even then only for certain models.
Click to expand...
Click to collapse
Yes there was a theory. And here is the final answer to that too:
http://teksoftco.com/forum/viewtopic.php?t=34&start=15
We had another attempt of making PhoneREC possible - by intercepting the voice flowing through the BT driver when a Bluetooth headset is connected:
1) when a call is established, the software would have enabled voice routing to Bluetooth headset
2) if a headset was not present, it would have been emulated (to be able to use the device without headsets with phonerec too)
3) voice data over bluetooth would have been in the form of SCO packets
4) our software would have intercepted the SCO packets, extract the voice data, record it to a file, and play it on the device's speaker (so no need of using the headset to hear the other party in the call)
Unfortunatelly this failed too, as the SCO packets are handled in the hardware, so we found no way of capturing those from a software program.
The only remaining option is to use a custom made wired headset with PhoneREC. This works and assures high fidelity sound for both parties, but the phoneREC user can only record the phone call by using the special wired headset.
Click to expand...
Click to collapse
So consider the subject closed, and sorry for the bad news,
Radu

Sound profiles

I use the w100 wired remote with my trinity, and use a in ear headset piece to listen to my music in the the public transport.
Is it possible that when people call me I will hear the incoming call trough the headset and not trough the phone speakers? because now im hearing both and its kinda pointless if its using the phone speakers aswell.
Ive tried putting the phone on vibrate but then my media player wont work anymore.
I know its possible to turn every sound on vibrate but isnt there a vibrate profile piece of software that puts the phone onto vibrate but I will still be able to listen to music and hear an incoming call?
Hi,
You might wanna try PocketMax's PhoneAlarm.
It has so many settings, setting everything right takes 10 runs of trial and error, but thus far I have been able to do anything I've wanted.

Categories

Resources