home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1996
/
ARCHIVE_96.iso
/
discs
/
mag_discs
/
volume_9
/
issue_01
/
soundcon
/
!SoundCon
/
!Help
< prev
next >
Wrap
Text File
|
1995-05-25
|
18KB
|
405 lines
S o u n d C o n
=================
version 1.50, 24-05-95
by Rick Hudson
This software is FreeWare. It must only be distrubuted in its original form.
The PlaySample module is also FreeWare and can be used in other applications
but you must obtain my permission if you wish to distribute it separately
from SoundCon.
Summary
=======
SoundCon is an application for basic sound sample format conversion on the
Archimedes. It can read and write samples in a variety of formats common on
various computer platforms and can directly playback most the formats it can
read (without converting it first). An important feature of SoundCon is that
all processing and playback is done from disc meaning that the only memory
required is for the application itself and there is no limit to the sample
size.
As of version 1.40 SoundCon can respond to render requests from ArcWeb so
that WWW sounds can be played by just clicking on them.
See the version history at the end of this file for a summary of changes and
additions to this version.
Other documentation
===================
The Docs directory within !SoundCon contains further information on the
PlaySample module and the various sound formats supported. The latter
contains format descriptions, what sub-formats are and aren't supported,
limitations of them and which ones can be played without conversion.
Interactive help is supported. Theoretically, you should be able to stop
reading this now and use that.
Supported formats
=================
Major formats sub-formats
Audio IFF 8/16 bit, mono/stereo
Armadeus n/a (8 bit mono signed linear)
ARMovie 8/16 bit, (un)signed linear, VIDC, mono/stereo
Sun Audio 8 bit A/╡-law, 8 bit lin, 16 bit lin, mono/stereo
AudioWorks 8/16 bit (un)signed, A/╡-law, VIDC, mono/stereo
Datavox 8/16 bit (un)signed, ╡-law, VIDC, mono/stereo
IFF/8SVX n/a (8 bit mono signed linear)
Psion S3a n/a (8 bit mono A-law 8kHz)
VOC n/a (8 bit mono unsigned linear)
Voice modules 4 volume modes, fixed/var frequency, voice/transient
RIFF WAVE 8/16 bit PCM, A/╡-law, MS/DVI ADPCM, mono/stereo
Raw data 8/16 bit, (un)signed lin, A/╡-law, VIDC, mono/stereo
For more information on these formats see the file Docs.Formats which
describes in more details what the formats can support and what the menu
sub-options do.
==============
Using SoundCon
==============
Loading a sample:
================
SoundCon is sample converter so it can't do anything until you give a
sample. Drag a file onto the icon bar icon or any of it's windows to 'open'
the sample. The settings of the preferences may cause some actions to happen
automatically at this point (see later) but the default is not do anything
except open the sample information window (click select on the icon bar icon
to open it if you need to). This window displays information about the file
loaded. If the format is not recognised (or a recognisable format is
unsupported - WAVEs have several such formats) then an error message is
reported and sample is loaded as raw data.
Changing the interpretation:
===========================
Recognised formats will not usually have to be fiddled with but raw data
will probably have to have the interpretation of the data changed to make
it sound right - this is largely a trial and error process.
At the bottom of the sample info window (click on Toggle Size or scroll
down) there is the interpretation format and frequency - use the pop-up
menus to change these. The format selections are summarised by interactive
help (if your version of RISC OS isn't too old) and described in more detail
in the file docs.Formats.
The interpretation frequency sets how many sample frames per second to
assume. A sample frame is the samples on all channels at any given point and
so frames per second means samples per channel per second. The menu provides
a list of common frequencies as well as a writable entry for other
frequencies.
Listening to the sample
=======================
The playback control window can be opened by clicking Adjust on the icon bar
icon or by selecting the menu item in the sample info window or icon bar
menus. The sample will be played based on the format and frequency set in the
Interpret As section of the sample info window. An exception to this are
samples that cannot be interpreted as raw data by SoundCon (ADPCM and
Audioworks formats) which can only be played in their original format.
The CD-style buttons control the playback and their use should be obvious.
The slider marking the sample progress can be dragged around as an
alternative to setting the sample position with the cue and rewind buttons.
The volume slider controls the volume and the speaker button toggles the
speaker on and off. If the volume is changed or the speaker toggled from
another application then SoundCon updates the volume slider and speaker
button automatically. Note though that the volume is independant of the
normal system volume so other system-volume controllers will have no effect.
The percentage above the volume slider shows the volume that will be used
when the slider is pushed right to the top. If you click on it, it will
switch between 100% and 200%; the latter mode allowing a sample to be
amplified. Distortion due to clipping will occur if the sample is amplified
too much.
The writable icon box beside the volume slider is the numeric setting of the
volume. You can type in a value here to set the volume if you wish.
Mono samples can be played with a simulated stereo effect by having two
channels playing the same thing with one lagging slightly behind the other.
Click on the mono echo button (under the speaker button) to toggle this
feature on and off. The echo delay is set in the preferences. This option has
no effect on stereo samples and has not been implemented for ADPCM formats.
Note that the ADPCM play routines are quite CPU intensive (since they
decompress on the fly) and the sound quality will probably suffer when
interrupts are used heavily (eg lots of disc activity).
Converting the sample to another format
=======================================
Open the conversion window from the info window or icon bar menus. The
current destination format is shown with the usual elements of a save box.
Change the format, sample rate and filename (if current settings are not
suitable) and drag the icon to where you want the new sample to be or click
OK/press Return if a complete path is already present. The conversion
progress window will open and the conversion will occur in the background.
The conversion can be paused if you need the computer to be more responsive
for a while or aborted by clicking the appropriate button.
The filename initially present in the convert window will depend on the
preferences (see Preferences for options).
The conversion produces a sample (in the specified format) so that playing
it at the speed set in the 'Rate' box will sound the same as the original
sample played at the speed set the 'Frequency' box of the 'Interpret As'
section. That is, the sample is resampled at the new frequency. If the
frequencies are different then new samples are generated by linearly
interpolating between the original samples.
See the file Docs.Formats for a description of the supported formats and
their sub formats.
Preferences
===========
Default Conversion format: This controls what output format will initially
be in the conversion save box when the program is loaded. This format may
also be set on loading a new sample (see Auto Load Actions below). The
effect of these settings is described in 'Converting a sample' above. The
option 'Auto #chnls', when selected, will set the number of channels in the
output format the same number of channels as the source (if the format
permits). This happens when the sample is first loaded and can still be
changed manually.
Interpret Unknown As: When an unrecogised sample is loaded, the data will be
initially interpreted according the settings in this box. The pop-up menus
are identical to those for the Interpret As part of the info window (see
'Changing The Interpretation' above).
Auto Actions On Load: Any combination (including none) of the following
actions are performed when a new sample is opened.
- Open info window: The window displaying the information on the sample is
opened.
- Open convert window: The conversion/save window is opened.
- Open play window: The play control window is opened.
- Default format: The format and frequency used for the output sample is
set from the Default Conversion Format part of the preferences.
- Convert: The conversion process is started using the format and filename
determined from other preference settings.
- Play: The sample is played back.
If either convert or play (or both) are selected then the sample is cleared
after their respective operation has completed to allow the next queued
sample to be processed automatically. If convert AND play are selected then
the sample is cleared after both have finished.
Sound: This section specifies how to set up the sound system on loading
SoundCon:
- Set volume: If this option is set then the playback volume is set
according the slider below otherwise it is left unchanged. Note that
this only affects the volume for the PlaySample module which is
independant of the normal system volume.
- Don't set speaker: The speaker is left in the current state (on or off).
- Speaker off: The speaker is switched off.
- Speaker on: The speaker is switched on.
- Mono echo: Set the delay between channels in centiseconds (0-99) for a
simulated stereo effect on mono samples. If this is set to zero, mono
samples are played using one channel only. This option has no effect on
stereo playback or ADPCM formats. The actual delay is limited to 2048
sample frames so the maximum delay in seconds is 2048/rate. eg at 11111Hz
2048/11111 = 18cs. This option is enabled and disabled in the playback
window.
File naming: These options control what filename will appear in the
conversion/save box when a new sample is opened:
- Do not update name: The writable icon is left the same as when it was
last used.
- New leaf with previous path: Everything up to the last '.' is preserved
and remainder (the leaf) is replaced with the leaf name of the source
sample. This is the only useful file naming option for queue processing.
- New leaf-only name: The filename is set to the leaf name of the source
sample.
- Add/change extentions: When this option is set an extension of the form
'/XXX' is appended to the filename (after one is generated from the
above options). XXX is an MS-DOS like abbreviation like WAV, AIF, RAW
etc. The leaf is not truncated to 10 characters in case you want to copy
it to a filing system supporting longer filenames.
If the auto-convert option and 'New leaf with previous path' is not selected
then a warning is displayed when you exit the preferences window because
queue processing can only be done with that option set. (no update can be
used but all the samples will overwrite each other!)
General: Miscellaneous options
- D-click load: SoundCon repsonds to the Dataload message allowing it to
load samples by double clicking on them. It attempts to load any file
that is 'launched'. If it recognises it loads it otherwise it is ignored
so oher applications still get a look in.
- ArcWeb render: When this option is set, SoundCon responds to rendering
requests from ArcWeb. If the file to be rendered is a recognised sound
format and SoundCon is idle then it will be loaded and played.
- Font: This sets the font that SoundCon will use for all its text. RiscOS
3.5 users should leave this set to 'system font' so that the OS will use
the current desktop font. Apparantly there is a bug in RO3.5 that causes
font problems if an outline font is used in the slab buttons. This
feature is mainly for use in OS versions before 3.5.
Queue processing
================
SoundCon can process a queue of samples as well as single samples; this is
so that a whole bunch of samples can be converted (or played) without user
intervention. The restrictions are that all the samples in the batch will be
converted to the same format and will all be placed in the same directory.
A sample may be explicitly loaded into the queue by dragging one into the
queue window (opened from the icon bar menu). If more than one sample is
dragged to into SoundCon then the first will be dealt with normally (ie as
if it was a single file) and the rest will be queued automatically.
The queue works on the principle that when there is no sample open the one
at the front of the queue is opened (and removed from the queue). The
current sample will be cleared (and the first one queued opened) when:
- You clear it manually from the menu in the Sample Info window.
- A sample has finished converting and the 'Auto Actions on Load/Convert'
option is set from the preferences.
- A sample has finished playing and the 'Auto Actions on Load/Play' option
is set from the preferences.
The last two (auto-clear) instances do not occur if the queue is empty so
that the last sample in the queue remains the current sample.
This means all the files in the queue can be converted or played (or both)
automatically.
So if SoundCon is set to auto-convert on load, all the files in the queue
will convert automatically. Note however that when the first file is opened
the warning message 'To save, drag the file to a directory display' is
displayed. The first file needs to be dragged manually to determine where to
save the samples. You should also select what you want them all converted
to at this point. A result of this is that conversion can only progress
automatically if the file naming method is set to 'New leaf with previous
path' otherwise the warning will be given for every file or the files will
all have the same name and overwrite each other. If you select auto-convert
and the file naming is set to something inappopriate, you are warned when
you close the preferences window.
You will need to change the format and output path (if necessary) before you
load the queue a second time because there will now be suitable defaults to
begin conversion immediately. Alternatively, clear the filename or the entire
sample to set things up after the queue is loaded.
Using SoundCon with ArcWeb
==========================
From version 1.40 SoundCon can play samples for ArcWeb by responding to its
rendering requests. The 'ArcWeb render' preference must be set and SoundCon
must be idle (ie not converting or playing another sample) to repsond to
ArcWeb requests because it 'loads' the sound as its current sound which would
mean halting any previous activity. While the sound is 'loaded' it can be
converted/saved or played again until a new sound is loaded or it disappears
from the ArcWeb cache.
History
=======
1.30 - First release
1.40 - Cleaner logarithmic sound conversion
- Cleaned up glitches on standard-res monitors
- Added read-only ARMovie format
- Added ArcWeb sound playing
- Sun Audio files with zero data length can now be loaded
- Lowered lower frequency limit after discovering some 5Khz samples
- First button in preference window now works. (how'd that happen?!)
- Mouse is now constrained when dragging sliders
- Doesn't crash if sample disappears between loading and converting
1.41 - Made Arcweb rendering optional
- Dataload option added to allow loading by double-clicking
- Made preference window resizable
1.42 - Fixed bug re dragging play slider on 16-bit samples
- Dragging to playback window when already playing now plays
- Changing format with 'extensions' on now works
1.50 - Fixed last-sample-in-queue bug
- Type 0 AU and some incomplete-headered AU handling added
- Added Wave filetype (FB1)
- Hi-res player buttons added (thanks Trev)
- Some mouse button actions tidied up
- Fixed a bug causing some spikes in conversions
- Fixed /0 error (opening prefs) when Armadeus is the default format
- Does not respond to shift-double-clicks now
- Fixed WAVE block alignment bug affecting samples > 1 byte/frame
- Added Psion S3a format (thanks Jasper)
- Added ARMovie export
- Added A-law format to Psion, AU, Audioworks, RIFF and raw
- Added 100%/200% (normal/amplify) volume switch
- Added typable numeric volume display
- Added mono echo (simulated stereo) to front end
- Removed queue size limit; stored in file now
- Auto mono/stereo selection in output to match source
- Changes to PlaySample module (now 2.43)
- Added A-law support
- Volume range now 0 to 255 (200%=amplify) with 127=100%
Problems?
=========
I have tried to ensure that SoundCon can process a wide variety of sample
formats and sub-formats and because of this it has been hard to find original
files to test them all with. Please let me know (e-mail address below) if you
encounter a sample that SoundCon doesn't process correctly; several small
bugs have been fixed because of this kind of feedback. I'd also be interested
to hear if there are any other unsupported formats that could be included in
SoundCon's repertoire; bearing in mind that I need some information about the
format before I can implement it.
Acknowledgements:
================
Thanks to the following people who mades useful suggestions, supplied
information or did testing:
Andrew, Stewart Brodie, Trevor Johnson, Jasper Wallace, John Brand, Are
Leistad, Nick Bannon and Chris Poole.
Rick Hudson
rick@actrix.gen.nz