Author Topic: Remove speaker output from Mic input?  (Read 16242 times)

0 Members and 1 Guest are viewing this topic.

Mr_Grinch

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Remove speaker output from Mic input?
« on: November 08, 2010, 12:38:57 PM »
I'm guessing it's not possible, or would take up for too much in the way of resource, but is there no way you can cancel out the audio output from the computer speakers, with the mic input?

For instance I use the PS3 Eye as my microphone, occasionally when watching a film (even in standby mode), what the characters say can sound enough like my key word to activate a command. Being the computer knows what audio it's outputting, would it not be possible to then take account of this on the mic input and remove it (or at least as best it can)?

I know it's beyond the scope of Vox Commando as a piece of software but I was curious if anyone knew if something like this has been/is being developed.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #1 on: November 08, 2010, 02:11:19 PM »
It is possible, but not with the ps3eye.  To some extent the microphone array aspect of the ps3eye should help the mic to focus on your voice, but it's not perfect.

currently, if you plug something in to the mic input on your sound card, it is usually possible to enable "acoustic echo cancellation" on the windows recording device properties under the enhancements panel.  For this to work you need to be using the mic input and be playing your output through the same chipset device.  So for example on my laptop I have two jacks, 1 input and one input that both run though my realtek chipset, and it works, though I have not stress tested it.

There are pure hardware solutions.  Some devices, especially headsets, use two microphones, one pointed toward the speaker and the other pointed away.  The sound that is coming from the away mic is subtracted from the mic pointed at the speaker.  Of course for this to work, the two microphones need to be correctly oriented and relatively close to your mouth.

If you find that vox is either issuing commands or switching to listen mode when not intended, you should consider changing your prefix and/or listen phrases.  Consider also, using only one phrase for listen that is not too short.  The word "listen" by itself is a poor choice.  Something like "begin listen mode" will most likely get a high confidence score, and virtually no false positives.

If you use prefix mode, be sure your prefix has at least two syllables.   Using a woman's name (e.g. Erika) as the prefix can work well, but may incur a very low W.A.F. ;)

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #2 on: November 08, 2010, 04:26:58 PM »
I have borrowed my brother's Microsoft Cinema WebCam with integrated mic. It was USB connected so it doesnt you my soundcard, but it was still able to cancel out the sound played by my on-board soundcard. It was really good at 'understanding' me eventho the music was playing relatively loud. Audio cancellation didnt work for the digital-out tho, so it doesnt work aswell when playing a movie.

The problem I had with the webcam was that it would turn itself off for no reason and it would only switch on again after restarting Vox.

I'm still searching for the right mic. But I would like the same, a room-mic that does audio cancellation. When I have figured out how to get the webcam running constantly, I will probably pic that one.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #3 on: November 08, 2010, 04:38:19 PM »
I don't know if your web cam is actually turning off (as in to save energy) or if it is temporarily losing the usb connection.  Look on the options page of VC under "other options".  There is an entry called "Check mic status every (sec)".  By default it is set to 0 and doesn't do anything, but if you put in a value like 30, it will check every 30 seconds to make sure it is connected to the mic and if not, try to re-establish the connection.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #4 on: November 08, 2010, 04:41:16 PM »
also, you may have better luck if you try a different usb slot.  Avoid using a usb hub, and if using  a desktop, plug in to a usb port directly on the motherboard rather than one that is wired to a panel on the front of the case.

I had a similar issue on my laptop and certain usb ports seemed better than others.  On my desktop the ports at the back were more reliable than the front ones.

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #5 on: November 08, 2010, 05:17:08 PM »
Hmm setting the 'check for mic' options seems to do the trick. I have set it to 30sec. Sweet, time to order me one of these puppies :)

I have added a wma file, this is a recording of the input of the mic (after audio cancellation). During this audio fragment, the audio coming from my speakers is actually as loud or louder than my voice.

Like I said, this will not work when you are using digital out (for example when playing a movie), because the audio stream will not be processed and therefor the mic is unaware of it. You would still need something like an attention-button on your remote. Persoanlly I dont think that is a big problem, because while watching movies, I always have my remote nearby.
« Last Edit: November 08, 2010, 05:29:35 PM by abom »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #6 on: November 08, 2010, 06:36:37 PM »
awesome.  It's good to know that some usb devices support this function, all the usb devices I have seen have not had it.

I would also love to hear back to back recordings from this device with "acoustic echo cancellation" turn on and turned off.  Just to get a sense of how effective that actual feature is.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #7 on: November 08, 2010, 06:43:02 PM »
I have added a wma file, this is a recording of the input of the mic (after audio cancellation). During this audio fragment, the audio coming from my speakers is actually as loud or louder than my voice.
Abom, I love your accent.  Listening to that, the music still sounds pretty loud.  I'm proud of VC for being able to cope, but now I really want to hear it with the cancellation on  vs. off...

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #8 on: November 09, 2010, 05:07:59 AM »
Yea I'm Dutch...I find it weird hearing my own voice :)

I have been looking around in the settings for the webcam and I haven't found an option to turn on or off noise cancelling. Maybe it's in the sound config panel, I will check when I get back home. The music in the audio fragment does sound loud when you just listen to it, but the volume coming from my speakers was very loud for testing purposes (I wouldn't usually play music that loud) and the speakers were closer positioned to the mic than I was.

I have done some additional testing, monitoring how VC responds to the audio level. With my setup there is a big difference between playing music and watching movies or series. VC will respond to pretty much everything that is being said when playing a movie. However when playing music I have to set the volume to an uncomfortable level for VC to think it's hearing commands.

I guess I have to find a practical method that works for everything. Is there a chance that we could get VC to stop listening to commands while XBMC is playing a movie (unless it's paused)? :) I know I could add a 'stop listening' action to the VC command, but I rarely select a movie out of my head and usually just scroll through my movies.
« Last Edit: November 09, 2010, 06:59:29 AM by abom »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #9 on: November 09, 2010, 08:51:25 AM »
Quote
I guess I have to find a practical method that works for everything. Is there a chance that we could get VC to stop listening to commands while XBMC is playing a movie (unless it's paused)?  I know I could add a 'stop listening' action to the VC command, but I rarely select a movie out of my head and usually just scroll through my movies.

I don't know.  I think xbmc may broadcast it's current state.  I would have to look into it to see if there is a way I could tap into that.

Do you use a remote as well?  Are you using prefix mode?

You could create a command "play this item" that does a "select" and then goes into standby.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #10 on: November 09, 2010, 11:29:59 AM »
the command:

SetBroadcast(1;33333)

will tell xbmc to send broadcasts on certain events.  If you use eventGhost, you might be able to find a way.  I don't want to spend too much time on this, because I think this function is probably depracated and soon I will need to switch everything for xbmc over to the new json interface.

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #11 on: November 09, 2010, 12:05:51 PM »
I do use eventghost for my remote. Is there a way to send a command from EG to VC?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #12 on: November 09, 2010, 12:22:21 PM »
you know it baby  :yay

just paste this into your eventGhost tree.  (you need to have broadcaster installed)

Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1462">
    <Folder Name="Set VoxCommando State" Expanded="True">
        <Macro Name="Broadcaster: Broadcast: vox&amp;&amp;on" Expanded="True">
            <Action>
                BroadcastListener.Broadcast(u'vox', u'on', 33000)
            </Action>
        </Macro>
        <Macro Name="Broadcaster: Broadcast: vox&amp;&amp;off" Expanded="True">
            <Action Name="Broadcaster: Broadcast: vox&amp;&amp;off">
                BroadcastListener.Broadcast(u'vox', u'off', 33000)
            </Action>
        </Macro>
        <Macro Name="Broadcaster: Broadcast: vox&amp;&amp;standby" Expanded="True">
            <Action Name="Broadcaster: Broadcast: vox&amp;&amp;standby">
                BroadcastListener.Broadcast(u'vox', u'standby', 33000)
            </Action>
        </Macro>
        <Macro Name="Broadcaster: Broadcast: vox&amp;&amp;Single" Expanded="True">
            <Action>
                BroadcastListener.Broadcast(u'vox', u'Single', 33000)
            </Action>
        </Macro>
    </Folder>
</EventGhost>

note that you can also send simple text and it will emulate as if you had said the text (same idea as tellvox).

I am planning on adding the ability to send any command without emulation... eventually.  The problem with emulation is that if VC is busy decoding actual speech there will be a conflict.  To be honest, I'm not sure exactly what happens in that situation. :-[

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #13 on: November 09, 2010, 12:25:21 PM »
Heading home, will give you an update on this in a few hours :)

Wanilton

  • $upporter
  • Hero Member
  • *****
  • Posts: 559
  • Karma: 6
    • View Profile
    • XBMC Brazil Forum
Re: Remove speaker output from Mic input?
« Reply #14 on: November 09, 2010, 12:56:10 PM »
I tested and it worked, however I tried to set the keys green, red and yellow on the remote for the PS3 and he did not shoot the commands, command works when run from the context menu of eventghost, James, check the attached file, now use these three keys as a shortcut in XBMC to switch between libraries, but I prefer to use them with voxcommando.
www.xbmcbrasil.net
XBMC  Brazilian Community Forum - Admin
Windows 8.1 - XBMC Gotham Custom Plus - Aeon MQ 5
My Room Entertaiment´s
About me