[FIX][BUG] StreamingMP3Sound not playing in stereo

Craig Latta craig.latta at netjam.org
Fri Feb 7 20:58:43 UTC 2003


Hi--

        I sent a fix to the list a while ago, but it bounced. Here 'tis
again...


-C

***

Hi--

        StreamingMP3Sound was playing stereo files as mono; the attached
change
fixes it.

        thanks,

-C

---

'From Squeak 3.2 of 11 July 2002 [latest update: #4917] on 23 January
2003 at 2:26:44 pm'!

!StreamingMP3Sound methodsFor: 'private' stamp: 'crl 1/23/2003 14:26'!
loadBuffersForSampleCount: count
        "Load the sound buffers for all tracks with the next count
samples from the MPEG
file sound track."

        | snd buf |
        1 to: mixer sounds size do: [:i |
                snd _ mixer sounds at: i.
                buf _ snd samples.
                buf monoSampleCount = count ifFalse: [
                        buf _ SoundBuffer newMonoSampleCount: count.
                        snd setSamples: buf samplingRate:
streamSamplingRate].
                i = 1 ifTrue: [  "first channel"
                                mpegFile
                                        audioReadBuffer: buf
                                        stream: mpegStreamIndex
                                        channel: 0]
                        ifFalse: [  "all other channels"
                                mpegFile
                                        audioReReadBuffer: buf
                                        stream: mpegStreamIndex
                                        channel: 1]].
        mixer reset.
! !

--
Craig Latta
improvisational musical informaticist
craig at netjam.org
www.netjam.org/resume
Smalltalkers do: [:it | All with: Class, (And love: it)]



More information about the Squeak-dev mailing list