The goal of this project is to experiment with transmitting images through the telephone using tone volume (amplitude).
First I created a java application that loops through the pixels of an image and analyzes their brightness. For each pixel it emits a tone. The tone's amplitude and frequency are determined by the brightness of the pixel, so darker pixels create lower, quieter sounds, and brighter pixels emit louder, higher frequency sounds. The sounds are generated at a rate of 15 frames / 15 pixels per second.
Second, I used the Megaphone client / API for java to pick up the amplitude of incoming volume on a telephone call, and at the same rate of 15 pixels per second reassemble the image. (Megaphone is a service used for creating screen based projects or applications where the phone becomes a controller or a way to participate. It dynamically generates phone numbers for instances of the applications, and allows developers to easily let participants dial into their program. It has an easy way to detect button presses on their phones, and an api for easily turning amplitude of their voice into values in your code.)
Although my first attempt was very slow, I was really happy with the result.
This is the original image:
This is the first megaphone Fax I sent, by producing the sound with my computer using a java sound library, and holding my cell phone up to the speaker, after having dialed the MegaPhone generated phone number. (the reason the image is cut off is that megaphone cuts you off after one hour.)
I was really impressed with the result. It was done through a phone connected to the Megaphone app, that was picking the audio output of the computer.
Here is the flow in the first example:
Next I experimented with some lower resolution images, taking a sampling every 5 or 2 pixels, and these were much less interesting, but were helpful in working more quickly. I also connected the output of processing through SoundFlowerBed to the input of skype, so that I wouldn't have to listen to the sound, which at this point is pretty annoying.
Here is the new flow:
The audio must have been less noisy, bypassing audio in the room and any physical phone glitches, but I am using lower resolution for speedier results:
This was the second attempt, and rendered very quickly(probably a minute). It has lost a lot of information.
This was a 2*2 pixel transmission, that took about 15 minutes. It had also lost some information, and contrast. The audio signal received is mapped to the generated shade of gray (between 0 and 255). Because the range of the received value tends to vary, both based on the output settings, and the connection, I am now trying to figure out a way to have the program learn to adjust its own range based on the current input. For example, if the maximum received value is constantly being hit, it should increase a little, and while it is not being reached it can degrade a slower pace. The same can be applied to the minimum volume received.
In this next one I have created the following learning mechanism:
This seems like it is way too complicated for what I want, but it works, and I'm not sure how to simplify it. The volume range is 0 to 1. But in the Megaphone program neither limit is ever reached except by some random accidents. So, I start both the upper and lower volume limits (minimumVol and maximumVol) at 0.5, and continue to adjust them throughout the transmission to reflect the input.
It seems to have worked, and hopefully this means I don't have to adjust the code to every situation, since it can adjust itself.
It got cut off at the same moment as the last one, I guess it is a skype or Megaphone time limit. But I think the contrast and color mapping is better.
But the result is really interesting. I think the black dots are a result of the crackling I heard through Zoiper.
2nd attempt got cut off at the same time so the next step is to have the sketch keep drawing to save its place, so I can call it back.