Home User CP Donate Chat Register Today!  
  Get New posts Faq / Help?
   


Go Back   Hackint0sh > Projects and Hacks > iPhone > General > Hardware

Reply
 
LinkBack Thread Tools Display Modes
  #71 (permalink)  
Old 06-08-2008, 10:21 AM
jumpjack
Status: Offline
Member
 
Join Date: May 2008
Posts: 40
Rep Power: 0
jumpjack is on a distinguished road
Default

Ok, I need some help (again :p )
I found this freeware program which apparently allows synthesizing any kind of sound in any file format... but I'm quite confused by the documentation, due to my poor english I guess...

I'd like to generate, for example, a WAV file made up just of tones and silences this way (durations are in microseconds):
2800 tone
888 silence
444 tone
444 silence
444 tone
444 silence

How do I accomplish this using SOX? I don't even know if it is possible to have us precision...

On site documentation is quite poor, you have to look at the program package.
I paste here what I think is the relevant part of the documentation from soxeffect.txt (but I maybe wrong):

Quote:
synth [len] {[type] [combine] [freq[-freq2]] [off] [ph] [p1] [p2] [p3]}
This effect can be used to generate fixed or linearly swept fre-
quency audio tones with various wave shapes, or to generate
wide-band noise of various ‘colours’. Multiple synth effects
can be cascaded to produce more complex waveforms; at each stage
it is possible to choose whether the generated waveform will be
mixed with, or modulated onto the output from the previous
stage. Audio for each channel in a multi-channel audio file can
be synthesised independently.

Though this effect is used to generate audio, an input file must
still be given, the characteristics of which will be used to set
the synthesised audio length, the number of channels, and the
sampling rate; however, since the input file’s audio is not nor-
mally needed, a ‘null file’ (with the special name -n) is often
given instead (and the length specified as a parameter to synth
or by another given effect that can has an associated length).

For example, the following produces a 3 second, 44.1 kHz, audio
file containing a sine-wave swept linearly from 300 to 3300 Hz:

sox -n output.au synth 3 sine 300-3300

and this produces an 8 kHz version:

sox -r 8000 -n output.au synth 3 sine 300-3300
Quote:
The following example shows how two synth effects can be cas-
caded to create a more complex waveform:

sox -n output.au synth 0.5 sine 200-500 \
synth 0.5 sine fmod 700-100
Quote:
A detailed description of each synth parameter follows:

len is the length of audio to synthesise expressed as a time or
as a number of samples; 0=inputlength, default=0.

The format for specifying lengths in time is hh:mm:ss.frac. The
format for specifying sample counts is the number of samples
with the letter ‘s’ appended to it.

type is one of sine, square, triangle, sawtooth, trapezium, exp,
[white]noise, pinknoise, brownnoise; default=sine

combine is one of create, mix, amod (amplitude modulation), fmod
(frequency modulation); default=create

freq/freq2 are the frequencies at the beginning/end of synthesis
in Hz or, if preceded with ‘%’, semitones relative to A
(440 Hz); for both, default=%0. If freq2 is given, then len
must also have been given. Not used for noise.

off is the bias (DC-offset) of the signal in percent; default=0.

ph is the phase shift in percentage of 1 cycle; default=0. Not
used for noise.

p1 is the percentage of each cycle that is ‘on’ (square), or
‘rising’ (triangle, exp, trapezium); default=50 (square,
triangle, exp), default=10 (trapezium).

p2 (trapezium): the percentage through each cycle at which
‘falling’ begins; default=50. exp: the amplitude in percent;
default=100.

p3 (trapezium): the percentage through each cycle at which
‘falling’ ends; default=60.

tempo [-q] factor [segment [search [overlap]]]
Change the audio tempo (but not its pitch) using a ‘WSOLA’ algo-
rithm. The audio is chopped up into segments which are then
shifted in the time domain and overlapped (cross-faded) at
points where their waveforms are most similar (as determined by
measurement of ‘least squares’).

By default, linear searches are used to find the best overlap-
ping points; if the optional -q parameter is given, tree
searches are used instead, giving a quicker, but possibly lower
quality, result.

factor gives the ratio of new tempo to the old tempo.

The optional segment parameter selects the algorithm’s segment
size in milliseconds. The default value is 82 and is typically
suited to making small changes to the tempo of music; for larger
changes (e.g. a factor of 2), 50 ms may give a better result.
When changing the tempo of speech, a segment size of around
30 ms often works well.

The optional search parameter gives the audio length in mil-
liseconds (default 14) over which the algorithm will search for
overlapping points. Larger values use more processing time and
do not necessarily produce better results.

The optional overlap parameter gives the segment overlap length
in milliseconds (default 12).

See also stretch for a similar effect.

treble gain [frequency [width[s|h|o|q]]]
Apply a treble tone-control effect. See the description of the
bass effect for details.

tremolo speed [depth]
Apply a tremolo (low frequency amplitude modulation) effect to
the audio. The tremolo frequency in Hz is given by speed, and
the depth as a percentage by depth (default 40).

Note: This effect is a special case of the synth effect.

trim start [length]
Trim can trim off unwanted audio from the beginning and end of
the audio. Audio is not sent to the output stream until the
start location is reached.

The optional length parameter tells the number of samples to
output after the start sample and is used to trim off the back
side of the audio. Using a value of 0 for the start parameter
will allow trimming off the back side only.

Both options can be specified using either an amount of time or
an exact count of samples. The format for specifying lengths in
time is hh:mm:ss.frac. A start value of 1:30.5 will not start
until 1 minute, thirty and ½ seconds into the audio. The format
for specifying sample counts is the number of samples with the
letter ‘s’ appended to it. A value of 8000s will wait until
8000 samples are read before starting to process audio.

vol gain [type [limitergain]]
Apply an amplification or an attenuation to the audio signal.
Unlike the -v option (which is used for balancing multiple input
files as they enter the SoX effects processing chain), vol is an
effect like any other so can be applied anywhere, and several
times if necessary, during the processing chain.

The amount to change the volume is given by gain which is inter-
preted, according to the given type, as follows: if type is
amplitude (or is omitted), then gain is an amplitude (i.e. volt-
age or linear) ratio, if power, then a power (i.e. wattage or
voltage-squared) ratio, and if dB, then a power change in dB.

When type is amplitude or power, a gain of 1 leaves the volume
unchanged, less than 1 decreases it, and greater than 1
increases it; a negative gain inverts the audio signal in addi-
tion to adjusting its volume.

When type is dB, a gain of 0 leaves the volume unchanged, less
than 0 decreases it, and greater than 0 increases it.

See [4] for a detailed discussion on electrical (and hence audio
signal) voltage and power ratios.

Beware of Clipping when the increasing the volume.

The gain and the type parameters can be concatenated if desired,
e.g. vol 10dB.

An optional limitergain value can be specified and should be a
value much less than 1 (e.g. 0.05 or 0.02) and is used only on
peaks to prevent clipping. Not specifying this parameter will
cause no limiter to be used. In verbose mode, this effect will
display the percentage of the audio that needed to be limited.

See also compand for a dynamic-range compression/expansion/lim-
iting effect.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #72 (permalink)  
Old 06-09-2008, 09:49 AM
jumpjack
Status: Offline
Member
 
Join Date: May 2008
Posts: 40
Rep Power: 0
jumpjack is on a distinguished road
Default

UPDATE:

I did more tests. Result:

I successfully used a nokia 6680 to remote control a Synudyne TV, an LG DVD recorder, a Satellite receiver, a Video tape recorder and a DTT receiver!
And all of this was possibile using just ONE single IR LED connected to headset port!

I used SOX to generate single on/off carrier chunks and SHNTOOL to concatenate them into a singol WAV file.

Now I'd like to know HOW it is possible! Does my 6680 produce 38000 Hz audio signals?!? What is it, a bat-phone?!?
If it just produces 19000 Hz signals... why the "mono" audio-out of nokia 6600 does not accomplish same task?!?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #73 (permalink)  
Old 06-09-2008, 09:54 AM
Former Bender's Avatar
Former Bender
Status: Offline
Guest
 
Join Date: Nov 1970
Posts: 3,501
Rep Power: 0
Former Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud of
Default

Dude, you are off topic now, this thread is about using iPhone and iTouch as IR remote, not nokia.

You should find a Nokia forum and post there. I guess they will be happy.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #74 (permalink)  
Old 06-09-2008, 04:13 PM
jumpjack
Status: Offline
Member
 
Join Date: May 2008
Posts: 40
Rep Power: 0
jumpjack is on a distinguished road
Default

actually I'd like to know if the "one-led solution" is applicable for other devices than mine. Maybe also IPOD can work with one single led? If yes, we should review are guesses about the sound-to-IR device!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #75 (permalink)  
Old 06-09-2008, 05:20 PM
Former Bender's Avatar
Former Bender
Status: Offline
Guest
 
Join Date: Nov 1970
Posts: 3,501
Rep Power: 0
Former Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud ofFormer Bender has much to be proud of
Default

No, the iPod can't work with one IR LED, simply because it has an Asymmetrical (+, Ground) audio output when your Nokia uses Symmetrical output (+, -, Ground).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #76 (permalink)  
Old 06-09-2008, 06:38 PM
trapper
Status: Offline
Member
 
Join Date: May 2008
Posts: 55
Rep Power: 4
trapper is on a distinguished road
Default

Quote:
Originally Posted by jumpjack View Post
You're right.
Indeed technics described in this thread are mostly for users of uncommon remotes, which can't find suitable configuration files for their devices: being able to just sample&replay a remote should allow anybody with an audio-capable handheld to use it as remote control clone.
So if I have a common remote then this is vastly simplified. So am I able to simply load an existing config file into this program and it will work with that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #77 (permalink)  
Old 06-10-2008, 08:34 AM
jumpjack
Status: Offline
Member
 
Join Date: May 2008
Posts: 40
Rep Power: 0
jumpjack is on a distinguished road
Default

I'm not sure I got what you mean...

Actually I didn't yet wrote a program: I demonstrated that a remote control can be cloned using:
- 2 IR transmitter LED
- an audio recorder software
- an audio editing software (Audacity, Linux/Win32/MacOSX), or an audio synthesizer software (SOX, Linux/Win32 , SOXWrap , MacOSX)

Until I'll be able to write a "decoder software" for the recorded audio, you'll need to re-build your signal from scratch. At the beginning I did it totally by hand: i created a 38 KHz tone and I silenced it by hand where needed (comparing to the sampled audio signal) like the one in the picture).

http://www.planetmobile.it/jumpjack/LedRem/remote-justled.jpg

Now I found a program, SOX , which can create a wave file made up of tones and silences of desired length.

You use it to build "pieces" of wavefile, which then you join together (with COPY /b in DOS, or CAT in Unix), and finally you use SoX again to add proper headers.

Here you find some DOS batch files I'm working on to generate WAV files (look at CREATE.BAT):
http://www.planetmobile.it/jumpjack/LedRem/batches.zip

Building SoX in MacOSX

Other link for SoXWrap

It would be interesting to know if Mac users too can use my method to turn their computers/phones into remotes.

It would be also interesting if anybody could write a program which automatically calls SOX depending on contents of sampled waveform... Unfortunately I never wrote before a sound-processing software, although I wrote many software in basic, c, java...

Last edited by Former Bender; 06-10-2008 at 11:10 AM. Reason: Do not post Jumbo Sized pictures, thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #78 (permalink)  
Old 06-10-2008, 10:45 AM
jumpjack
Status: Offline
Member
 
Join Date: May 2008
Posts: 40
Rep Power: 0
jumpjack is on a distinguished road
Default

I published a short tutorial about how to create WAV files to clone remote controls using any audio capable device (iPhone, Pod, cellphone, PC,... MP3 player?):
http://jumpjack.wordpress.com/2008/0...emote-control/

The tutorial is O.S. indipendent (Unix, Windows, MacOSX, or whatelse, it does not matter ).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #79 (permalink)  
Old 06-12-2008, 06:18 AM
dougwi
Status: Offline
Junior Member
 
Join Date: Oct 2007
Location: Brasil
Posts: 11
Rep Power: 0
dougwi is on a distinguished road
Send a message via MSN to dougwi Send a message via Skype™ to dougwi
Default

It´s a really great project....
Thanks XianLi
__________________
OTB 1.1.1 --> 1.1.2 --> 1.1.3
BL 3.9
Activated/Jailbroken/Unlocked!!!
Call In/Out: Yes/Yes
SMS In/Out: Yes/Yes
WiFi/Edge: Yes/Yes
Carrier: Claro
BRASIL!!!!
Gorilaz Paintball
Mednanet.com.br - Medicine Nove de Julho
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Sponsored links Remove advertisements
Advertisement
Advertisement

  #80 (permalink)  
Old 06-14-2008, 05:34 PM
jumpjack
Status: Offline
Member
 
Join Date: May 2008
Posts: 40
Rep Power: 0
jumpjack is on a distinguished road
Default

I wrote a couple of program which make authomatic the tedious work:
RAW2LIRC gets a WAV file (resulting from remote control sampling using 1 transmitting led) and creates a proper LIRC file.
LIRC2LEDREM creates a DOS batch file per each command found in LIRC file.
Each DOS batch creates the corresponding WAV file to play on... iPod or whatelse.

Sorry, my programs only run in Windows... but they should also work fine inside an emulator, I guess.

Batch files are just made up of a list of SOX call, so it's esay to port them to any system supporting SOX.

Here are the files:
http://www.planetmobile.it/jumpjack/LedRem/LedRem.zip
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +2. The time now is 03:20 AM.



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 Ad Management by RedTyger
follow us on Twitter!

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105