mp3s sound funky on Squeak ( Windows )

John M McIntosh johnmci at smalltalkconsulting.com
Mon Aug 19 20:31:02 UTC 2002


>Thanks for the help, guys.  By the way, I'm running the 3.2.2 Windows VM.
>
>I tried a couple of the Speaker class examples, they sound like 
>they're garbled as well. 
>
>I tried Johh McIntosh's script below ( thanks for not telling me to 
>RTFM for MPEGPlayer, John ... ) and got a debugger because the 
>MPEGPlayer instance's "external" variable was nil.
>I tried doing 'debug it' on the script below and found that the 
>first line of code in MPEGPlayer>>initialize is returning nil.
>
>MPEGPlayer>>isFileValidMPEG is returning false for  this filename:
>'C:\My Music\BlindBoysOfAlabama\RealWorld\Last Time.mp3'
>
>It looks like isFileValidMPEG is a call to a primitive.  Any 
>suggestions for how to debug a primitive?
>
>
>"Run this"
>
>| foo |
>foo _ MPEGPlayer playFile: 'my.mpg'. "provide the file name here"
>foo playStreamWaitTilDone: 0 "To play audio/video as currrent process"

It doesn't like the path, or the extension is wrong, later version of 
the plugin don't really care about the extension, which version of 
the windows plugin are you using?

The isFileValidMPEG just checks to see if it can find the file, and 
if found if it seems to contain mpeg data. Also earlier versions 
checked the extension (case sensitive, this was dropped in later 
versions).

Tru sticking the file in the same directory as the image and just 
refer to it as
'Last Time.mp3'

However if you get garbled sound on working with the Speaker class 
then the issue is either Squeak is having trouble dealing with sound 
playback, or your sound system on that windows? machine is 
funky/garbled.

However lets check to see if something else isn't funky with Squeak, 
IE a process spining away. Remember the VM is a multi-tasking 
Operating system, and the process you start to play the audio does 
need to share time and resources with other processes that are runing 
in Squeak, so lets confirm nothing werid is going on.

ProcessBrowser open

and then in the left pane
option click (at least on the mac to get the pane menu)
to turn auto update on and CPUWatcher on

In a basic image, I've got

the timer interrupter watcher  "Delay logic"
Delay>>wait	"Part of the the CPU Watcher"
The CPUWatcher  "Ya, ok"
The I/O process "Pull events from the VM to give to the UI Process"
the user interrupt watcher  "Look for the break key"
the low space watcher	"attempts to indicate if space is low, 
usually doesn't work"
the WeakArray finalization process  "Finaliazation cleanup after a GC"
my auto-update process "Part of Process Browser"
the UI Process  "The Morphic update/step thread"
the idle process "Runs if  nothing else is dispatchable to sleep squeak"


Normally we should see 20 some percent for the UI process, and 80 
some percent to the idle process, if nothing else is going on. If you 
swirl the cursor around cpu for the I/O process might go up to 40% as 
it pulls an endless stream of mouse move events from the VM event 
queue.

Got any other process running?

If not, then check your VM version against the current windows 
version and upgrade if needbe.
Then you're off to well update your windows version? Update your 
audio drives, run Norton, Norton antivirus etc etc. Also confirm 
you've not got some other process on your windows machine sucking up 
the CPU.


-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================



More information about the Squeak-dev mailing list