<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MythPyWii &#8211; now on Google Code</title>
	<atom:link href="http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/</link>
	<description>Benjie Gillam's blog, and home of MythPyWii - probably the best Wii remote (Wiimote) interface to MythTV - see sidebar.</description>
	<lastBuildDate>Fri, 25 Jun 2010 06:25:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anthony</title>
		<link>http://www.benjiegillam.com/2010/01/mythpywii-now-on-google-code/comment-page-1/#comment-13038</link>
		<dc:creator>Anthony</dc:creator>
		<pubDate>Tue, 04 May 2010 09:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.benjiegillam.com/?p=335#comment-13038</guid>
		<description>One of the last pieces of the Wii-Mote to be discovered is it&#039;s speaker. Up until now, nobody has been able to successfully communicate with the speaker to produce sounds. Carl made a post today to the WiiLi forums including a script that will bring the Wii Mote&#039;s speaker to life. Much of the initial work to find the codes to send to the wii-mote was done by Marcan, so a good chunk of the credit for this discovery should go to him.

Here is the GlovePIE script you will need to test out the Wii-Mote&#039;s Speaker from Windows:

    // Carl Kenner&#039;s Wiimote Speaker Test script! Version 2
    // A = start sound, B = stop sound
    // Minus = decrease sample frequency
    // Plus = increase sample frequency
    // It takes a short time to start (due to delays built into Poke)

    // Change the next line to set the rate at which sound data is sent
    // BUT it must be low enough for the wiimote to respond to the B button
    // it may depend on your PC speed. Must be at least 91 for freq 13.
    pie.FrameRate = 120 Hz

    if not var.initialized then
    var.freq = 13 // Set sample rate = 3640 Hz (so computer can keep up)
    var.volume = 0x40 // volume = 40 ??? Seems to be about max
    debug = var.freq
    var.initialized = true
    end if

    if var.On and (not Wiimote.One) and (not Wiimote.Two) then
    // Report 18, send 20 bytes, square wave, 1/4 sample rate freq
    WiimoteSend(1, 0x18, 20 shl 3, 0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33, 0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33)
    else if var.On and Wiimote.One then
    // Report 18, send 20 bytes, square wave, 1/2 sample rate freq
    WiimoteSend(1, 0x18, 20 shl 3, 0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3, 0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3)
    else if var.On and Wiimote.Two then
    // Report 18, send 20 bytes, square wave, 1/8 sample rate freq
    WiimoteSend(1, 0x18, 20 shl 3, 0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33,0xCC,0xCC, 0x33,0x33,0xCC,0xCC,0x33,0x33,0xCC,0xCC,0x33,0x33)
    end if


    if pressed(Wiimote.A) then
    // Enable Speaker
    Wiimote.Report14 = 0x04 &#124; Int(Wiimote.Rumble)
    // Mute Speaker
    Wiimote.Report19 = 0x04 &#124; Int(Wiimote.Rumble)
    // Write 0x01 to register 0xa20009
    WiimotePoke(1, 0x04a20009, 0x01)
    // Write 0x08 to register 0xa20001
    WiimotePoke(1, 0x04a20001, 0x08)
    // Write 7-byte configuration to registers 0xa20001-0xa20008
    WiimotePoke(1, 0x04a20001, 0x00)
    WiimotePoke(1, 0x04a20002, 0x00)
    WiimotePoke(1, 0x04a20003, 0x00)
    WiimotePoke(1, 0x04a20004, var.freq)
    WiimotePoke(1, 0x04a20005, var.volume) // 40
    WiimotePoke(1, 0x04a20006, 0x00)
    WiimotePoke(1, 0x04a20007, 0x00)
    // Write 0x01 to register 0xa20008
    WiimotePoke(1, 0x04a20008, 0x01)
    // Unmute speaker
    Wiimote.Report19 = 0x00 &#124; Int(Wiimote.Rumble)
    var.On = true
    end if

    if pressed(Wiimote.B) then
    var.On = false
    Wiimote.Report19 = 0x04 &#124; Int(Wiimote.Rumble) // Mute Speaker
    Wiimote.Report14 = 0x00 &#124; Int(Wiimote.Rumble) // Disable speaker
    end if

    if pressed(Wiimote.Plus) then
    var.freq--
    debug = var.freq
    // Mute Speaker
    Wiimote.Report19 = 0x04 &#124; Int(Wiimote.Rumble)
    // Write 0x01 to register 0xa20009
    WiimotePoke(1, 0x04a20009, 0x01)
    // Write 0x08 to register 0xa20001
    WiimotePoke(1, 0x04a20001, 0x08)
    // Write 7-byte configuration to registers 0xa20001-0xa20008
    WiimotePoke(1, 0x04a20001, 0x00)
    WiimotePoke(1, 0x04a20002, 0x00)
    WiimotePoke(1, 0x04a20003, 0x00)
    WiimotePoke(1, 0x04a20004, var.freq) // max volume?
    WiimotePoke(1, 0x04a20005, var.volume)
    WiimotePoke(1, 0x04a20006, 0x00)
    WiimotePoke(1, 0x04a20007, 0x00)
    // Write 0x01 to register 0xa20008
    WiimotePoke(1, 0x04a20008, 0x01)
    // Unmute speaker
    Wiimote.Report19 = 0x00 &#124; Int(Wiimote.Rumble)
    end if

    if pressed(Wiimote.Minus) then
    var.freq++
    debug = var.freq
    // Mute Speaker
    Wiimote.Report19 = 0x04 &#124; Int(Wiimote.Rumble)
    // Write 0x01 to register 0xa20009
    WiimotePoke(1, 0x04a20009, 0x01)
    // Write 0x08 to register 0xa20001
    WiimotePoke(1, 0x04a20001, 0x08)
    // Write 7-byte configuration to registers 0xa20001-0xa20008
    WiimotePoke(1, 0x04a20001, 0x00)
    WiimotePoke(1, 0x04a20002, 0x00)
    WiimotePoke(1, 0x04a20003, 0x00)
    WiimotePoke(1, 0x04a20004, var.freq) // max volume?
    WiimotePoke(1, 0x04a20005, var.volume)
    WiimotePoke(1, 0x04a20006, 0x00)
    WiimotePoke(1, 0x04a20007, 0x00)
    // Write 0x01 to register 0xa20008
    WiimotePoke(1, 0x04a20008, 0x01)
    // Unmute speaker
    Wiimote.Report19 = 0x00 &#124; Int(Wiimote.Rumble)
    end if


This is a huge accomplishment and you can bet that soon enough the hackers will be streaming all kinds crappy 4 bit sounds to their wii-motes. Let the fun begin!!!
Once again Carl, great work!

Next up is integrating the Speaker functionality into the other Windows Wii-Mote apps, as well as the Linux and OSX wii-mote programs. Developers will want to check out the WiiLi wiki for information on how to initialize the wii-mote speaker and send sounds to it.

Source: WiiLi.org</description>
		<content:encoded><![CDATA[<p>One of the last pieces of the Wii-Mote to be discovered is it&#8217;s speaker. Up until now, nobody has been able to successfully communicate with the speaker to produce sounds. Carl made a post today to the WiiLi forums including a script that will bring the Wii Mote&#8217;s speaker to life. Much of the initial work to find the codes to send to the wii-mote was done by Marcan, so a good chunk of the credit for this discovery should go to him.</p>
<p>Here is the GlovePIE script you will need to test out the Wii-Mote&#8217;s Speaker from Windows:</p>
<p>    // Carl Kenner&#8217;s Wiimote Speaker Test script! Version 2<br />
    // A = start sound, B = stop sound<br />
    // Minus = decrease sample frequency<br />
    // Plus = increase sample frequency<br />
    // It takes a short time to start (due to delays built into Poke)</p>
<p>    // Change the next line to set the rate at which sound data is sent<br />
    // BUT it must be low enough for the wiimote to respond to the B button<br />
    // it may depend on your PC speed. Must be at least 91 for freq 13.<br />
    pie.FrameRate = 120 Hz</p>
<p>    if not var.initialized then<br />
    var.freq = 13 // Set sample rate = 3640 Hz (so computer can keep up)<br />
    var.volume = 0&#215;40 // volume = 40 ??? Seems to be about max<br />
    debug = var.freq<br />
    var.initialized = true<br />
    end if</p>
<p>    if var.On and (not Wiimote.One) and (not Wiimote.Two) then<br />
    // Report 18, send 20 bytes, square wave, 1/4 sample rate freq<br />
    WiimoteSend(1, 0&#215;18, 20 shl 3, 0xCC,0&#215;33,0xCC,0&#215;33,0xCC,0&#215;33,0xCC,0&#215;33,0xCC,0&#215;33, 0xCC,0&#215;33,0xCC,0&#215;33,0xCC,0&#215;33,0xCC,0&#215;33,0xCC,0&#215;33)<br />
    else if var.On and Wiimote.One then<br />
    // Report 18, send 20 bytes, square wave, 1/2 sample rate freq<br />
    WiimoteSend(1, 0&#215;18, 20 shl 3, 0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3, 0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3)<br />
    else if var.On and Wiimote.Two then<br />
    // Report 18, send 20 bytes, square wave, 1/8 sample rate freq<br />
    WiimoteSend(1, 0&#215;18, 20 shl 3, 0xCC,0xCC,0&#215;33,0&#215;33,0xCC,0xCC,0&#215;33,0&#215;33,0xCC,0xCC, 0&#215;33,0&#215;33,0xCC,0xCC,0&#215;33,0&#215;33,0xCC,0xCC,0&#215;33,0&#215;33)<br />
    end if</p>
<p>    if pressed(Wiimote.A) then<br />
    // Enable Speaker<br />
    Wiimote.Report14 = 0&#215;04 | Int(Wiimote.Rumble)<br />
    // Mute Speaker<br />
    Wiimote.Report19 = 0&#215;04 | Int(Wiimote.Rumble)<br />
    // Write 0&#215;01 to register 0xa20009<br />
    WiimotePoke(1, 0&#215;04a20009, 0&#215;01)<br />
    // Write 0&#215;08 to register 0xa20001<br />
    WiimotePoke(1, 0&#215;04a20001, 0&#215;08)<br />
    // Write 7-byte configuration to registers 0xa20001-0xa20008<br />
    WiimotePoke(1, 0&#215;04a20001, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20002, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20003, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20004, var.freq)<br />
    WiimotePoke(1, 0&#215;04a20005, var.volume) // 40<br />
    WiimotePoke(1, 0&#215;04a20006, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20007, 0&#215;00)<br />
    // Write 0&#215;01 to register 0xa20008<br />
    WiimotePoke(1, 0&#215;04a20008, 0&#215;01)<br />
    // Unmute speaker<br />
    Wiimote.Report19 = 0&#215;00 | Int(Wiimote.Rumble)<br />
    var.On = true<br />
    end if</p>
<p>    if pressed(Wiimote.B) then<br />
    var.On = false<br />
    Wiimote.Report19 = 0&#215;04 | Int(Wiimote.Rumble) // Mute Speaker<br />
    Wiimote.Report14 = 0&#215;00 | Int(Wiimote.Rumble) // Disable speaker<br />
    end if</p>
<p>    if pressed(Wiimote.Plus) then<br />
    var.freq&#8211;<br />
    debug = var.freq<br />
    // Mute Speaker<br />
    Wiimote.Report19 = 0&#215;04 | Int(Wiimote.Rumble)<br />
    // Write 0&#215;01 to register 0xa20009<br />
    WiimotePoke(1, 0&#215;04a20009, 0&#215;01)<br />
    // Write 0&#215;08 to register 0xa20001<br />
    WiimotePoke(1, 0&#215;04a20001, 0&#215;08)<br />
    // Write 7-byte configuration to registers 0xa20001-0xa20008<br />
    WiimotePoke(1, 0&#215;04a20001, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20002, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20003, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20004, var.freq) // max volume?<br />
    WiimotePoke(1, 0&#215;04a20005, var.volume)<br />
    WiimotePoke(1, 0&#215;04a20006, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20007, 0&#215;00)<br />
    // Write 0&#215;01 to register 0xa20008<br />
    WiimotePoke(1, 0&#215;04a20008, 0&#215;01)<br />
    // Unmute speaker<br />
    Wiimote.Report19 = 0&#215;00 | Int(Wiimote.Rumble)<br />
    end if</p>
<p>    if pressed(Wiimote.Minus) then<br />
    var.freq++<br />
    debug = var.freq<br />
    // Mute Speaker<br />
    Wiimote.Report19 = 0&#215;04 | Int(Wiimote.Rumble)<br />
    // Write 0&#215;01 to register 0xa20009<br />
    WiimotePoke(1, 0&#215;04a20009, 0&#215;01)<br />
    // Write 0&#215;08 to register 0xa20001<br />
    WiimotePoke(1, 0&#215;04a20001, 0&#215;08)<br />
    // Write 7-byte configuration to registers 0xa20001-0xa20008<br />
    WiimotePoke(1, 0&#215;04a20001, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20002, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20003, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20004, var.freq) // max volume?<br />
    WiimotePoke(1, 0&#215;04a20005, var.volume)<br />
    WiimotePoke(1, 0&#215;04a20006, 0&#215;00)<br />
    WiimotePoke(1, 0&#215;04a20007, 0&#215;00)<br />
    // Write 0&#215;01 to register 0xa20008<br />
    WiimotePoke(1, 0&#215;04a20008, 0&#215;01)<br />
    // Unmute speaker<br />
    Wiimote.Report19 = 0&#215;00 | Int(Wiimote.Rumble)<br />
    end if</p>
<p>This is a huge accomplishment and you can bet that soon enough the hackers will be streaming all kinds crappy 4 bit sounds to their wii-motes. Let the fun begin!!!<br />
Once again Carl, great work!</p>
<p>Next up is integrating the Speaker functionality into the other Windows Wii-Mote apps, as well as the Linux and OSX wii-mote programs. Developers will want to check out the WiiLi wiki for information on how to initialize the wii-mote speaker and send sounds to it.</p>
<p>Source: WiiLi.org</p>
]]></content:encoded>
	</item>
</channel>
</rss>
