[GOODIE] OggPlugin
Russell Penney
russell.penney at tincanct.com
Mon Aug 25 23:20:43 UTC 2003
Lex,
I checked the class comments for most sound related classes. The Ogg
library returns 16 bit data with the channels interleaved, as far as I
can tell the same format as a stereo SoundBuffer. If you look at
MPEGFile and StreamingMP3Sound they use a MixedSound with 2 mono
SoundBuffers (well one for each channel to be exact). I decided that
because ogg returns the right format I would use a stereo SoundBuffer
just passed via a MixedSound. However the sound was pitched much lower
and with lots of clicks. I believe it was playing at half speed.
So I went back to a MixedSound with 2 mono SoundBuffers. My code returns
a stereo buffer and uses SoundBuffer>splitStereo. It seems like an
unnecessary overhead but it worked.
I have noticed there is not that much support for stereo in the code.
Most of the stereo functions of SoundBuffer arent used and a lot of
places don't check but assume it is mono.
As for the comment about a rewrite of the Sound stuff, I think there is
perhaps a cleverer way of doing things. So different file type are
supported better. i.e
AudioFile
WavFile
MP3File
OGGFile
SunAuFile
Or something like that
Russell
> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On
> Behalf Of Lex Spoon
> Sent: Tuesday, 26 August 2003 12:30 AM
> To: The general-purpose Squeak developers list
> Subject: RE: [GOODIE] OggPlugin
>
>
> "Russell Penney" <russell.penney at tincanct.com> wrote:
> > Any comments welcome, as I said before the sound system is a little
> > baffling (it didn't work with a stereo SoundBuffer but does
> work with
> > 2 nono SoundBuffers through a MixedSound)
>
> Ahhh, I was wondering what you found confusing. Please
> glance at the class comment for SoundPlugin and see if that
> helps. In particular, note that for playing monaural audio
> the internal format still uses 16-bit samples, but every
> other sample is ignored.
>
> Clearly there could be some better cross-linkage of comments;
> at the least the SoundBuffer comment should link to the
> SoundPlugin comment.
>
>
> Lex
>
>
>
> ---- SoundPlugin comment ----
> This plugin implements the main sound related primiives.
> Since it requires platform support it will only be built when
> supported on your platform
>
>
> FORMAT OF SOUND DATA
>
> Squeak uses 16-bit signed samples encoded in the host's
> endian order. A sound buffer is a sequence of "frames", or
> "slices", where each frame usually includes one sample per
> channel. The exception is that for playback, each frame
> always includes 2 samples; for monaural playback, every other
> sample is ignored.
>
>
More information about the Squeak-dev
mailing list
|