Author Topic: Remove speaker output from Mic input?  (Read 14608 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: 7713
  • 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: 7713
  • 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: 7713
  • 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: 7713
  • 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: 7713
  • 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: 7713
  • 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: 7713
  • 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: 7713
  • 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

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #15 on: November 09, 2010, 02:12:23 PM »
this is EventGhost basics.  You need to assign an event to the macro if you want it to run.  Press red on your remote.  An event will show up in the EventGhost log.  Drag the event onto your macro.  Now when you press red, the macro will run.

...or am I misunderstanding you?
« Last Edit: November 09, 2010, 02:29:24 PM by jitterjames »

Wanilton

  • $upporter
  • Hero Member
  • *****
  • Posts: 559
  • Karma: 6
    • View Profile
    • XBMC Brazil Forum
Re: Remove speaker output from Mic input?
« Reply #16 on: November 09, 2010, 02:29:56 PM »
This ok now...thanks
www.xbmcbrasil.net
XBMC  Brazilian Community Forum - Admin
Windows 8.1 - XBMC Gotham Custom Plus - Aeon MQ 5
My Room Entertaiment´s
About me

Mr_Grinch

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #17 on: November 11, 2010, 10:36:59 AM »

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. ;)

Cheers for that! I actually use "X B M C" as the keyword at the moment, but I don't know if that's a wise choice or not. Watching a couple of shows last night and it was picked up twice. I'm going to have a play around over the weekend with a few different keywords and see what works best for me.

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #18 on: November 11, 2010, 10:53:18 AM »
Is it possible to have VC check for a higher rate of reliability of the prefix-word than the rest of the sentence? That would less likely cause VC to pick up a command.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #19 on: November 11, 2010, 11:04:44 AM »
Cheers for that! I actually use "X B M C" as the keyword at the moment, but I don't know if that's a wise choice or not. Watching a couple of shows last night and it was picked up twice. I'm going to have a play around over the weekend with a few different keywords and see what works best for me.

I suspect that that may be a poor choice, but I'm not sure.  You could try using "Ex be em see".  It might work better.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #20 on: November 11, 2010, 11:15:28 AM »
Is it possible to have VC check for a higher rate of reliability of the prefix-word than the rest of the sentence? That would less likely cause VC to pick up a command.
It isn't possible with the current version.  It might be possible to do it but I'm not sure it is worth the effort.  I for one would have no use for it.  I think it makes more sense to choose a better prefix, and also to make sure that your "listen" command is not something that would be triggered by mistake.

If you can use something like the "Amulet Remote" then this is not an issue.  I will be doing a review and demo on this remote soon.  So far I am extremely impressed with it, but it is a bit expensive.  (I think it is $250 or $260 USD)

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #21 on: November 11, 2010, 11:41:54 AM »
I have seen that remote before, incombination with a speech recognition for MCE, which looked really nice too. Never heard anything from it for a while though. Yea it is very expensive. Does their software suite only work with/for MCE?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #22 on: November 11, 2010, 11:57:56 AM »
Yes, their software works only with MCE, but the remote works great with VoxCommando.  I am working in cooperation with Amulet as well to see if I can use some custom code for VoxCommando to take advantage of information about the position of the remote.  When you put the remote down so that it is horizontal the microphone turns off.  When you lift it to your mouth, it turns on and a red light lights up to let you know that it is ready.  I am hoping to also detect when this happens so that we can (optionally) lower the volume of our music or video while the microphone is on.

I have done tests with relatively loud music, and even without lowering the volume it works quite well because you hold the mic relatively close to your mouth, and after your command you just put it back down and it stops listening.

The range on this thing is also very good.  Up to 90 feet in open air.  I was able to go two floors up and to the other end of my house and was just starting to lose the connection at the far end of the house.

I believe it is compatible with any MCE IR receiver which means that all buttons can be reprogrammed using eventGhost.  It also has a learning function so certain buttons can be taught to control the volume on your TV etc.  In theory with the correct setup you could eliminate the need for all your other remotes.

The Amulet software seems to be very nicely tied in to Windows Media Center.  They have added a lot of stuff to MCE to improve the experience, and setup is extremely easy but I have not really tested that much because I am not really interested in using Media Center myself.
« Last Edit: November 11, 2010, 11:59:39 AM by jitterjames »

abom

  • Jr. Member
  • **
  • Posts: 15
  • Karma: 1
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #23 on: November 11, 2010, 12:10:15 PM »
I have watched a few movies about the remote and it does look nice. Personally I think the custom UI they designed for MCE is really ugly.

I think it is too expensive for my taste, since I already have a universal remote. If you are looking for both (mic and uni remote), I do think that it is a very interesting product. I guess I'd rather use a 'pay-attention' button on my current remote and a good/affordable mic, it's not very different from the amulet idea, instead of tilting it, you can just press a button.

I hope they gave you that remote for free, for development purposes! :)
« Last Edit: November 11, 2010, 12:13:12 PM by abom »

FLuX0r

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 0
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #24 on: November 11, 2010, 01:20:04 PM »
If you can use something like the "Amulet Remote" then this is not an issue.  I will be doing a review and demo on this remote soon.  So far I am extremely impressed with it, but it is a bit expensive.  (I think it is $250 or $260 USD)
Sounds interesting, I'm looking forward to your video.

Mr_Grinch

  • Jr. Member
  • **
  • Posts: 5
  • Karma: 0
    • View Profile
Re: Remove speaker output from Mic input?
« Reply #25 on: November 11, 2010, 06:25:52 PM »
Is it possible to have VC check for a higher rate of reliability of the prefix-word than the rest of the sentence? That would less likely cause VC to pick up a command.

I was thinking about that. I've changed my key word to "Holly" after the ship's computer from Red Dwarf (because I'm a geek). I suspect it'll be picked up easier than xbmc but I'm just going to play around with some words and see what I get :)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remove speaker output from Mic input?
« Reply #26 on: November 14, 2010, 05:03:22 PM »
If you can use something like the "Amulet Remote" then this is not an issue.  I will be doing a review and demo on this remote soon.  So far I am extremely impressed with it, but it is a bit expensive.  (I think it is $250 or $260 USD)
Sounds interesting, I'm looking forward to your video.
as promised:
http://voxcommando.com/forum/index.php?topic=324.0