Re: importing Macintosh AIFF [message #4233] |
Thu, 11 May 1995 00:00 |
sterner
Messages: 106 Registered: February 1991
|
Senior Member |
|
|
bso@acm.org (Bosco Y. So) writes:
> I'm trying to import sound samples into the Macintosh version of IDL to
> perform some simple frequency domain filtering.
. . .
> The problem is that SoundHandle takes forever to perform the conversions. I
> was wondering whether anyone has written code to import Macintosh AIFFs into
> IDL arrays. If so, can I use your code? The work I'm doing is non-commercial
> and is actually the final project for a graduate class in digital image
> processing and multimedia.
I just happened to have a *.aiff file that I could experiment with.
Mine was 16 bit integer data and was the recording of an echo at a
local dam (see ftp://fermi.jhuapl.edu/www/landsat/liberty.html,
click on the Liberty Dam link for more details on the echo).
I had no problem reading the data into IDL, here are the steps I used:
openr,1,'dam.aiff'
f=fstat(1)
help,/st,f
** Structure FSTAT, 10 tags, length=32:
UNIT LONG 1
NAME STRING 'dam.aiff'
OPEN BYTE 1
ISATTY BYTE 0
READ BYTE 1
WRITE BYTE 0
TRANSFER_COUNT LONG 0
CUR_PTR LONG 0
SIZE LONG 791062
REC_LEN LONG 0
d=intarr(791062/2)
readu,1,d
close, 1
plot,d
There is some header info at the beginning of the array, I don't
know the format and just ignored it. Good luck.
P.S. I tried to capture this echo last sunday but it was a bit windy
and the echo was not as intense as I've heard it in the past. A
parabolic microphone and camcorder was used. A friend digitized the
sound on a Mac. When I get a good recording I'll put it on the Web.
Ray Sterner sterner@tesla.jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
WWW Home page: ftp://fermi.jhuapl.edu/www/s1r/people/res/res.html
|
|
|