Audacity can import raw binary files, OK (though auto format can not work on nyquist-type sine signal :-), use nice sin first !).
Conversion can be done in any programing language. Well, just command prompt would be enough..
For example on Unix, I write
Code: Select all
echo 1234567 >> sample
bc prog < sample | bash > out
where
prog is the attached bc-program,
sample is an ascii file with numbers, ended with 1234567
out is the output file (I can check by
od -t x1 out, what is inside the file)
On windows, I install CygWin (
http://www.cygwin.com -> find Setup, RunIt), I make sure I have 'bc' installed (it might be in the small basic set or not)
(I install perl (if a lot of disk space) and chere , too :-) ), do cd /cygdrive/c/yourdirectory and do the same as on unix.
You might change big/little endian by exchangeing a and b on the print line.
If you would have some perl.exe, it could done similarly
Did not see attachment???, lets put it here
Code: Select all
# input: a sequence of numbers on lines,
# each representing a 16bit sample
# each between -32777 and +32768 or
# each between 0 and 65535
obase=16
fifteen=2^15
sixteen=2^16
define report_error_over(n) {
# we don't know this
# let's write something to the output and
# skip the rest of the file
#
# assume bash reads the output
obase=10
print "echo THERE WAS AN OVERFLOW ERROR, ", n," is too large >2n"
obase=16 # for sure
while (1) {
n = read()
if (n == 1234567) { halt }
}
}
while(1) {
n = read()
if (n == 1234567) { halt }
if (n >= sixteen) { n = sixteen-1; report_error_over(n) }
if (n < -fifteen ) { n = 0; report_error_over(n) }
if (n < 0) { n += sixteen }
a=n/256
b=n-256*a
print "printf 'x'", a, "'x'", b, "n"
}