<div><span class="gmail_quote">On 4/11/08, <b class="gmail_sendername">Jens Fursund</b> &lt;<a href="mailto:jens.fursund@gmail.com">jens.fursund@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Freerunners!<br><br>I was wondering if anyone know if it is possible to answer a call from<br>a headset while listening to music/podcasts. As in the music/podcast<br>
stops and the call takes over by a click on the answer/hangup button<br>on the headset. Furthermore it would be great if we could implement a<br>feature where either espeak would read the name aloud when the call<br>comes in, or you would be able to provide your own sound to the call<br>
(as to know who it is, without taking the phone out of your pocket, of<br>course).</blockquote>
<div>&nbsp;</div>
<div>This is a great idea.</div>
<div>I think the the headset only have one button for muting the mic. But not sure. If that is the case, we can easely solve it by capturing the input from the mic when an incomming call arrives, and if the mic is muted for at least one second, we can answer the call. Or we could do voice recognition. If you say &quot;hello&quot; when a call arrives, it answers the call... etc. Anyway, there should be no problem implementing some solution where you don&#39;t need to touch the phone. This is very nice if your phone is in you pocket while you are driving, etc. Also, it is nice when you use a BT headset. I think&nbsp;the solution&nbsp;of grabbing input from the mic could be simple, because it would be done equally no matter if you use BT/wired headset or any other&nbsp;kind of handsfree. But if we have a button on the headset, we just check for a key press.</div>

<div>&nbsp;</div>
<div>A pseudo code to better explain my idea:</div>
<div>&nbsp;</div>
<div>int&nbsp;handle_incomming_gsm_call()</div>
<div>{</div>
<div>&nbsp; ...</div>
<div>&nbsp; if (handsfree_has_ans_btn)</div>
<div>&nbsp; {</div>
<div>&nbsp;&nbsp;&nbsp; /* avoid the overhead of comparing sound if the</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; * handsfree has an answering button */</div>
<div>&nbsp;&nbsp;&nbsp; if (hansfree_ans_btn == pushed)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gsm_answer_call();</div>
<div>&nbsp; }</div>
<div>&nbsp; else if (mic_input_ans(mic_dev, snd_accept))</div>
<div>&nbsp; {</div>
<div>&nbsp; &nbsp; /* matches the caracteristics from the mic input stream </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; * with the caracteristics of an 1 second long wav file</div>
<div>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp;much like strstr()&nbsp;matches a string with a stream</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; *</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; * The&nbsp;snd_accept is an user recorded file which can be silence or </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; * or any other sound the user prefers to answer the call with</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp; */</div>
<div>&nbsp;&nbsp;&nbsp; gsm_answer_call();</div>
<div>&nbsp; }</div>
<div>&nbsp; ....</div>
<div>}</div>
<div>&nbsp;</div>
<div>-- <br>Please don&#39;t send me Word or PowerPoint attachments. See <a href="http://www.gnu.org/philosophy/no-word-attachments.html">http://www.gnu.org/philosophy/no-word-attachments.html</a><br><br>Join the FSF as an Associate Member at:<br>
&lt;URL:<a href="http://www.fsf.org/register_form?referrer=5774">http://www.fsf.org/register_form?referrer=5774</a>&gt; </div></div>