[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recode to Play MP3?



  To: Michael J. Mahon
On Wed, 9 May 2007 11:05:53 -0700, Michael J. Mahon wrote:

> Steve ][ wrote:
>> There was an app for 68k Macs that would play mp3s, it would first
>> recode them to AIFF and buffer them and play them (or replay from
>> bufer). 
>> 
>> Just wondering, from a technical standpoint by Those Who Know (TM),
>> what it would take to do anything similar on the IIGS. I was thinking
>> that recoding would be done on a Mac or PC and then copied over to the
>> IIGS, but I don't know if/what the platform could handle.
>
[snip Michael info about playing samples on 8 bit Apple IIs]
> 
> The IIgs (only) can play 8-bit sampled sounds while reading more of
> the file from (fast) disk, allowing a virtually unlimited length.
> I'm sure someone here remembers the name of that sound player...

There is a program called Oversampler that will play a sound file from
disk.  According to the documentation it only requires 16 KB of RAM to
run (although they didn't say how much GS/OS takes up to be able to run
the program :-) but it can play files that are the maximum allowed for
the file system you are using (ie. 16 MB for ProDOS).  It loads 8 KB of
audio data into RAM and starts playing it then loads the next 8 KB.

The program is pretty cool because, as the name implies, you can smooth
out the output a bit by using its oversampling abilities.  You can
either double or quadruple the size of the audio and the program fills
in the other one or three bytes automatically but you have to play the
sample at two or four times the frequency as well.  However, I believe
the program is just doing a simple linear fill between the two values
(ie. if the original audio has a 100 value followed by a 200 value then
2x oversampling would give 100, 150, 200 and 4x oversampling would give
100, 125, 150, 175, 200 regardless of what the value after the 200 is).

You can even add echo to the sample when you are playing it back.

Finally, you can also specify whether to play the left channel, right
channel, both channels (stereo) or use the internal speaker and this is
where some confusion came about years ago.  The program allows you to
load any type of file and it will treat it as a raw, 8 bit, mono audio
sample and will convert any $00 values into $01 so that the oscillators
won't stop in the middle of the file (handy for playing Mac sound files)
so it will happily let you open a WAV file that you transfer over from
your PC.  Some people thought that the stereo option meant it would play
the file in stereo but all it means is that it sends the audio to both
the left and right channels and the volume slider controls the
oscillator's volume.  The left and right channel options only output the
audio to the left or right channel so you can check your sound card and
speaker set up (although in the documentation the author admits he's not
sure why he added these options :-).  The volume slider for the left and
right channel options still controls the oscillator's volume.  If you
select the internal speaker mode, the volume slider adjusts the system
volume instead although I'm not quite sure why this should be handled
differently.  As far as I know, the system volume should never be
changed by a program, only the user, and to control the volume of sounds
a program plays back they should be changing the oscillator's volume.

At any rate, I wrote a simple program called StereoTest back then to
demonstrate to the people who thought Oversampler would play a stereo
WAV file in stereo that it didn't.  They should have realized there was
a problem when they had to double the frequency for a stereo WAV file
with oversampling turned off.  :-)  However, my program was written in
GSoft BASIC if I remember correctly, and was really slow at loading a
stereo WAV file and separating it out into the left and right channels.
It also had to load the entire file into memory before it could play it
so it isn't as useful as Oversampler in that regard.  It is kind of neat
to hear stereo sound samples coming from the IIgs, though.  :-)

That is another one of the projects I've been wanting to rework but
haven't had a chance to yet.
--- Synchronet 3.14a-Win32 NewsLink 1.85
A2Central.com - Your total source for Apple II computing.