* Re: [gentoo-user] Typewriter sound
@ 2011-08-31 15:18 99% ` Space Cake
0 siblings, 0 replies; 1+ results
From: Space Cake @ 2011-08-31 15:18 UTC (permalink / raw
To: gentoo-user
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
2010-08-17 21:34 keltezéssel, Albert Hopkins írta:
> On Tue, 2010-08-17 at 20:43 +0200, meino.cramer@gmx.de wrote:
>> Bill Longman <bill.longman@gmail.com> [10-08-17 20:16]:
>>> On 08/17/2010 10:56 AM, Albert Hopkins wrote:
>>>> On Tue, 2010-08-17 at 19:20 +0200, meino.cramer@gmx.de
>>>> wrote:
>>>>> Hi,
>>>>>
>>>>> on YouTube there was a Blender-2.5 tutorial with audio.
>>>>> There was an interesting detail: While there were spoken
>>>>> instructions one can hear one typing on its keyboard. Each
>>>>> hit on one of the keys made the sound of an old typewriter
>>>>> (no, it was not the sound of the legendary "IBM Model M"
>>>>> keyboard ;) ).
>>>>>
>>>>> How can I achieve this? What software can I use to make
>>>>> this geeky feature to come true. Unfortunately I have no
>>>>> idea, how to name this kind of what(?) ...
>>>>>
>>>>> Thank you very much for any hint in advance! Best regards,
>>>>> mcc
>>>>
>>>> There probably a number of ways to do this.
>>>>
>>>> A cheap and easy way would be to use xev to monitor a window
>>>> and then pipe the stderr to a a program that waits for a
>>>> keypress event and then plays an apropriate.
>>>>
>>>> A less cheap way would be to have our program do what xev
>>>> does instead of using a pipe.
>>>
>>> Or you could set your X keyclick using xset.
>>>
>>
>> Hi,
>>
>> thanks a lot for your replies! :) Is there any program already,
>> which does this? A daemon or...<insert missing words here>
>>
>> Best regards, mcc
>>
>>
>
> Well I found out that when you pass window id to xev it does not
> trap keyboard presses per-sé. But there is another way...
>
> Anway the following is a quick hack (in python). It pretty much
> works except it also seems to trap mouse presses. I got the .wav
> file at http://www.soundjay.com/typewriter-sounds.html
>
> I tried using 'xset c' but it basically does nothing for me. My
> guess is that it does work it basically sends the a BELL to the
> console.
>
>
> --- 8< CUT HERE
> --------------------------------------------------- import sys
> import subprocess
>
> soundfile = 'typewriter-key-1.wav'
>
> def main(): window_id = sys.argv[1] cmd = ['xev', '-id',
> window_id]
>
> p1 = subprocess.Popen(cmd, stdout=subprocess.PIPE) while True: line
> = p1.stdout.readline() if line.find('atom 0x14d') > -1:
> subprocess.Popen(['aplay', soundfile], stderr=open('/dev/null',
> 'w'))
>
>
> if __name__ == '__main__': main()
>
>
>
Guys, this is awesome :) Let's make an ebuild and put in portage :)
L:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOXlDCAAoJECu/a/sBwapoXS0IAMKolA55zV/mAQqlwe/qvk1w
HyVpirrOYYYQOsdJChnvYfpgWBUT0F8uwEaO1pLGdlACrN0VHYJMk45nC8PBtKkL
gkrnR0Q0Ew6bZ1DeXjd2x+jZEN5Am6vQCHxLd85OJfTvIM7Ahc+FdJWtfhcaO8IF
hXppxITOQ9hCH+iEhel6TTq4wAQjX/i0C6RsF9RTGbocAzCdpZSs/RPffQiHuScv
IBrKOxLCQ2TACmdYmbK47vCKH6rgsNDENWD19g9zVouHHtXLeBnavG42wV46qCUW
OmNoKFA00ZXmuVUhpyUhhLSv6D4n5w7TFKdNXFof6Whf6/9X82oVe4yQCgbC+E8=
=R2iT
-----END PGP SIGNATURE-----
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2010-08-17 17:20 [gentoo-user] Typewriter sound meino.cramer
2010-08-17 17:56 ` Albert Hopkins
2010-08-17 18:13 ` Bill Longman
2010-08-17 18:43 ` meino.cramer
2010-08-17 19:34 ` Albert Hopkins
2011-08-31 15:18 99% ` Space Cake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox