Giter Club home page Giter Club logo

quietnet's Introduction

Quietnet

Simple chat program using near ultrasonic frequencies. Works without Wifi or Bluetooth and won't show up in a pcap.

Note: If you can clearly hear the send script working then your speakers may not be high quality enough to produce sounds in the near ultrasonic range.

Usage

run python send.py in one terminal window and python listen.py in another. Text you input into the send.py window should appear (after a delay) in the listen.py window.

Warning: May annoy some animals and humans.

Screenshot

Installation

Quietnet is dependant on pyaudio and Numpy.

Better Projects

Quietnet is just a toy! Here are some more robust and polished projects to look at:

quietnet's People

Contributors

katee avatar richo avatar tevino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quietnet's Issues

listen.py TypeError and various other errors.

This is a really neat idea so I thought I would try it out. I had the following issues.
working directory on master branch at commit: 2acabf9

Running on:

uname -a
Linux ubuntu 3.5.0-45-generic #68~precise1-Ubuntu SMP Wed Dec 4 16:18:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Using:

python --version
Python 2.7.3

Installed numpy and pyaudio using apt-get.

Trying to run the listen script.

python listen.py
Quietnet listening at 19043HzALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'AC97 2ch->4ch Copy Switch',0,0,0): No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'AC97 2ch->4ch Copy Switch',0,0,0): No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (PCM,'IEC958 Playback PCM Stream',0,0,0): No such file or directory
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (PCM,'IEC958 Playback PCM Stream',0,0,0): No such file or directory
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (PCM,'IEC958 Playback PCM Stream',0,0,0): No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
Traceback (most recent call last):
File "listen.py", line 128, in
start_analysing_stream()
File "listen.py", line 121, in start_analysing_stream
input=True, frames_per_buffer=frames_per_buffer, stream_callback=callback)
File "/usr/lib/pymodules/python2.7/pyaudio.py", line 714, in open
stream = Stream(self, _args, *_kwargs)
TypeError: init() got an unexpected keyword argument 'stream_callback'

Trying to run the send script.

python send.py
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'AC97 2ch->4ch Copy Switch',0,0,0): No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (PCM,'IEC958 Playback PCM Stream',0,0,0): No such file or directory
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1614:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
Welcome to quietnet. Use ctrl-c to exit
test
test
ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred

Send.py crashes and exits on bad input

On Mac OS X using iTerm. Hit up arrow to get ^[[A. Hit enter. Following error:

> ^[[A
Traceback (most recent call last):
  File "send.py", line 56, in <module>
    pattern = psk.encode(message)
  File "/Users/tklovett/code/quietnet/psk.py", line 106, in encode
    result.append(psk[c] )
KeyError: '\x1b'

jack server is not running or cannot be started

Quietnet listening at 19043HzALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started

Error correcting codes?

I noticed that quietnet has issues with errors etc...
http://www.eccpage.com/ might be of assistance here..

and golay ecc was of use in this radio telemetry firmware.. in c

https://github.com/tridge/SiK/blob/master/Firmware/radio/golay.c

  and thanx for quietnet.. it has inspired some discussions on [email protected] 

on encryption.. I would not worry to much till the error correction is added as most encryption needs 7 or 8 bit clean and error corrected.. when you get to that stage then Stef with PBP a curve 25519 replacement candidate for gpg would be my recommendation for integration with...https://github.com/stef/pbp

minimodem and blurt just dont cut it for tradecraft ie walter mitty spy vs spy type scenarios(course the NSA TAO has a bug on dear old walter mitty's computer I betcha!) as they are too clearly audible. At 61 and with tinnitus I cant even hear quietnet
:)

    gh

Wrong Output

Does anyone has values of bottom_threshold and frame_length for which the script is working perfectly. I tried my luck but not getting the results.

ALSA, Jack server errors

Under Ubuntu 15.04 I run python listen.py and get this:

Quietnet listening at 19100HzALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed

Any solution?

Python 2.6 - ubuntu 10.4

bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) Welcome to quietnet. Use ctrl-c to exit > hola Traceback (most recent call last): File "send.py", line 51, in message = input("> ") File "", line 1, in NameError: name 'hola' is not defined

raw_input error and ALSA lib problems

Hello there, as a github newbie I encounter some problems on my machine running Manjaro Linux. Any help will be appreciated

I have the requirements installed and when running send.py I get the following messages:

ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
Welcome to quietnet. Use ctrl-c to exit
Traceback (most recent call last):
File "send.py", line 51, in
message = raw_input("> ")
NameError: name 'raw_input' is not defined

Is anyone else getting this?

Test that pyaudio works

I am not able to get this to work. The problem may be with pyaudio. I believe the listening works, due to #3, but I am not able to tell if the output works. How can I play a clearly audible sound with pyaudio? Maybe there should be a script included with this that does that.

this issue come when i want to run speech to text program using python.

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

send/receve data to internet server

is posible to send and recive small data from old PC where in not available INTERNET conection ?
In this area is available voice GSM signal and old mobile phone.

for this i want to:

  1. conect speakers and microphones from old PC with 3.5mm stereo cable to the GSM phone
    2.call to a number to make conection with a server
    3.send and recive data

Calibration

I have noticed that there are a couple issues regarding the mis-calibration of quietnet.
See #3, #14 for those that I've read.

Given that listen.py and send.py are separate scripts, a third script should be able to run those in a controlled way, sending various messages through send.py and validating the received result in listen.py and subsequently adjusting the threshold and frame_length, etc, and then re-running the tests until the result is accurate.

To make this plausible, there would have to be a distinct configuration file (currently options.py, although threshold must be moved within there, too) that could be edited and reloaded. Also, the listen.py and send.py would be to be able to be used by another Python script, the calibrator.py for instance.


@Katee, I'd be up for creating a Pull Request, if you like the idea. I will need some guidance, both because I'm relatively inexperienced with Python and also because I believe this will require some major refactoring, so I'd definitely want your input on that ๐Ÿ˜„.

'module' object has no attribute 'paInt16'

I've installed pyaudio from source and pynum via pip. Python version 3.3.3. I get this error:

File "send.py", line 6, in
FORMAT = pyaudio.paInt16
AttributeError: 'module' object has no attribute 'paInt16'

Katee, what was your test environment?

Hey Katee,
What was your test environment for quietnet? I've tried with no luck. I am using realtek HD audio speakers on a six core computer running Windows Vista. I have 16 gigs of ram, of course Windows only allocates a few gigs. If this will run better on Linux, then I'll boot over to that. I was trying to communicate to my laptop and it didn't work. I've modified the files trying to get them to work with no luck. I defaulted back to your files, since mine didn't work. I've seen others having the issue of it not working, so I am curious how you got it to work. what computers and speakers did you use?

Screen

Do you think that it could come configured with 'screen' for linux so you could organize the send and recieve into one window? Wondering your thoughts. I'd be happy to try and put something together if you think it would be useful.

edit: Moreover would you be interested in a QTgui of sorts down the road?

Listen.py not working properly

installed pyaudio and nmpy
both send and listen.py works bt still listen.py didnt detect any text from send.py

any demo how it works!

High frequency cause "index out of bounds"

If the frequency in "options.py" is bigger then 21736, the following error appears in "listen.py":

$ python2 listen.py
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "listen.py", line 39, in process_frames
    point = quietnet.has_freq(fft, search_freq, rate, chunk)
  File "/home/construidor/src/quietnet/quietnet.py", line 28, in has_freq
    if top < np.average([fft_sample[peak-offset], fft_sample[peak+offset]]):
IndexError: index out of bounds

speech recognition problem in ubuntu

i try this code
import speech_recognition as sr
r=sr.Recognizer()
with sr.Microphone() as source:
print("Speak any thing")
audio = r.listen(source)

try:
    text=r.recognize_google(audio)
    print('You said: {}'.format(text))
except:
    print("Sorry Can not Recognise your voice")

and got this problem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Speak any thing

Small mistake in Readme

The readme says " ... your speakers may not high quality enough to produce sounds ... " :D

I'm not native but I believe it should be like: " ... your speakers may not be high quality enough to produce sounds ... "

Problems under ubuntu

I think everything is normal until this:

volkan@ubuntu:~/Belgeler/quietnet$ python send.py
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
bt_audio_service_open: connect() failed: Connection refused (111)
ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Welcome to quietnet. Use ctrl-c to exit

But when I send something, i receive the following:

ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

As a result, nothing comes in listening part. What can be the problem?

Encryption

Would this be feasible? Thoughts? I feel like a preshared key would work with some public private key encryption method. I wonder if there would be a way to do some type of Tonal key as well. Like emit a certain sound to authenticate the chat.

Hearing Stuff

Really nice program/PoC. Thank you Kate.

For those like me who can't hear the sounds generated (at least by laptop speakers), try PulseEffects with the equalizer 'Pre' value raised to 2 or above. Everything then sounds very clear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.