Buglet in AIFF support in 2.3beta
Mark Guzdial
guzdial at cc.gatech.edu
Thu Jan 14 15:40:47 UTC 1999
There's a buglet (not a serious bug) in Squeak 2.3beta in the SampledSound
fromAIFFfileNamed: class method. The AIFF reader seems to ignore the
recorded sampled sound rate (maybe it's not there? I thought it was
encoded in the AIFF file, but I'm a newbie to sound formats), and instead
fromAIFFfileNamed: hard codes it as 11025 -- which is half of what Macs
record at (using SimpleSound). The result is sllllooooowwwww
pllllaaayyybbaacckk. Just tweak the 11025 to 22050 to get improved
playback (see below).
Mark
fromAIFFfileNamed: fileName
"Read a SampledSound from the AIFF file of the given name assuming
a default sampling rate."
"(SampledSound fromAIFFfileNamed: '1.aif') play"
"| snd |
FileDirectory default fileNames do: [:n |
(n endsWith: '.aif')
ifTrue: [
snd _ SampledSound fromAIFFfileNamed: n.
snd play.
SoundPlayer waitUntilDonePlaying: snd]]."
| data |
data _ self rawDataFromAIFFfileNamed: fileName.
data _ self convert8bitSignedTo16Bit: data.
^ self samples: data samplingRate: 22050
--------------------------
Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280
(404) 894-5618 : Fax (404) 894-0673 : guzdial at cc.gatech.edu
http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html
More information about the Squeak-dev
mailing list
|