Changes

Jump to: navigation, search

Cassette data information

4,254 bytes removed, 18:32, 8 June 2017
/* Writing */
All modern sound cards should support 8-bit and 16-bit samples and sample rates of 22050 Hz and 44100 Hz. Some sound cards will support a greater range of recording rates which can be lower and higher than these values. The familiar format of CD audio uses a sampling rate of 44100 Hz and a bit-depth of 16-bits. These values are more than adequate to represent almost all real-world signals for listening by humans - and also, conveniently, are fine for Amstrad tapes, too! In fact, in theory, because the standard Amstrad tape routines have a maximal frequency of 2500 Hz, settings as low as 8000 Hz and 8 bits would probably be fine. However, you will probably want to use higher settings, just in case and/or to keep in line with more common formats such as CD audio, especially if you intend to archive your recordings.
The hardware tape data separator inside the CPC only extract 1-bit of information out of the sound signal that comes in. So, using 16-bit instead of 8-bit samples provides no gain at all.
 
For samp2cdt, you should save the file as "PCM" ("Pulse Code Modulation"). This is a uncompressed, unencoded storage representation. Each sample is a single measurement of the amplitude of the sound taken at a measurement point in time. Other representations such as "ADPCM" ("Amplitude Delta Pulse Code Modulation"), encode or compress the data to reduce the size of the audio file. Samp2cdt can't understand these representations, so please use "PCM" only. Another reason to avoid "ADPCM" is that it is a lossy compression format. "PCM" is lossless, so it's better suited for data storage.
===Illustrations and explanations of digital audio===
[[Image:wave7.gif]]
''Fig 7. An amplitude/time graph showing the sampled waveform. As explained in the note for Figure 4, this is only a visual representation of the digitally stored audio, '''not''' of the signal that would be output by any competent audio card. However, it does illustrate how low sampling rates reduce the bandwidth of frequencies: This waveform was generated at a low sample rate, and therefore the resulting waveform is much more coarse compared to Fig 4. Notice that although the general shape is similar to the original waveform, much of the smoothness is is lost between the time of each measurement. The loss of smoothness also means loss of information: the lower the sampling rate, the more information is lost; in other words, the maximal frequency that the signal can represent is lower. Similarly, lower bit-depths mean that the signal is less accurate, and in extreme cases can generate audible noise. Therefore, to record a sound, it is best to use relatively high sampling rate and bit-depth; CD audio's 44.1 kHz and 16 bits -bit should be more than adequate for most uses. Due to the way the CPC hardware process the sound signal, especially 16-bit has zero advantage over 8-bit for CPC cassettes. To sum it up, 44.1kHz and 8-bit is recommended for storage of CPC cassettes.''
Notes:
A loader on the computer must therefore be able to identify the actual sound of the data from other sounds that are on the cassette. If it can't do this, then there will be loading errors.
If you are transfering a cassette using samp2cdtCSW2CDT, then you are advised to use an original (i.e. a cassette created directly from a master cassette), or a first generation copy (i.e. a cassette copied from an original).
== Loader ==
1. The CPC464 and CPC464+ have a cassette player built in. To connect a cassette player to the CPC664, CPC6128 or KC Compact then you must use a lead.
2. It is not known exactly how the amplitude of the sound from the cassette corresponds to the final "0" or "1" measurement.
 
samp2cdt uses a crude method to perform this conversion.
 
For a 8-bit signed sample:
 
* if the amplitude is 0..127, then the final measurement will be "1".
* if the amplitude is -128..0 then the final measurement will be "0".
=== Writing ===
If the state of bit 5 is changed at a fixed frequency, then the graph of the state of bit 5 over time will be a square wave. However, the resulting audio written on the cassette will not be a perfect square wave because nature will attempt to convert the waveform into a sine wave.
Loading system audio waveform
 
Every loading system on the Amstrad uses a serial bit-stream. i.e. a single bit of information is read at a time.
 
This serial bit-stream is grouped into blocks of audio sound.
 
Every loading system uses a basic structure to describe each audio block in the following order:
 
|pilot|sync|data|trailer|
 
'''pilot'''
 
This is also refered to as "leader" by some documents.
 
This is constructed from a repeated waveform often with a fixed number of repetitions defined by the loading system.
 
The shape of the waveform is known by the loader program and this is used to identify the pilot waveform from other waveforms that may be present (e.g. noise).
 
The pilot is often long, so that the loader doesn't need to see the start of the pilot waveform in order to load the block.
 
The loader program will test the incoming waveform, checking it against the parameters defined for the pilot, before the waveform is accepted as the pilot waveform. (e.g. the number of repetitions must be some defined minimum value). The incoming waveform must fall within these specifications otherwise the waveform is not accepted as a pilot waveform.
 
'''sync ("synchronisation")'''
 
The sync is a waveform which is different to the pilot, and this defines the end of the pilot and the start of the data. When this sync has been detected, the loader knows that there is data following, and that the loader is always at the same point in the data stream. i.e. the loader program is synchronised to a specific point in the data waveform.
 
'''data'''
 
This is the actual data which is composed of waveforms defining "0" and "1" data bits.
 
The first element of the data may be a marker or id which may, for example, indicate the type of data in the block or the number of the block.
 
The remaining bits will define the data and zero or more checksums.
 
The whole data may consist of a single block with a single location and length (e.g. one block for a screen another for data), or multiple blocks each with their own location and length. (e.g. one block for screen and data)
 
The location and lengths of the blocks may be in the data stream itself, or they may be in a preceeding block, or may be hard-coded into the loader program.
 
'''trailer'''
 
The trailer always follows the data. Some loaders may not have a trailer. The two main purposes of the trailer are to ensure that the waveform of the last data bit in the data is constructed correctly and to provide some time in which the loader can prepare for the next block.
The exact definition of the loading systems's audio waveform is defined by the loader program.
 
samp2cdt has a number of decoder algorithms which recognises the audio waveform of various loading systems. These decoders read the waveform using a similar method to the loader program itself. These decoders have been created by examining the instructions of each loader program and the graph of the waveform in a sound recording package.
== Example of a typical loading system ==
== Various Audio file formats ==
There are numerous Audio file formats, each of which can store audio, but each has it's its own structures and representation for the data.
The "format" of a file describes the internal structure, order and encoding of the data within the file.
 
Here is a list of the audio file formats supported by samp2cdt:
 
* Windows Wave file (a file which has the ".wav" file extension) is the common file format used for audio sounds on computers running "Windows".
* A Voice Wave file (a file which has the ".voc" file extension) was created by Creative for the original Soundblaster ISA sound card. This file format is used by the original voc2tzx utility which samp2cdt was developed from.
* A Audio Interchange file (a file which has the ".aiff" or ".aif" file extension) is the common file format used for audio sounds on the Mac computer.
* A file which has the ".iff" file extension is the common file format used for audio sounds by the Amiga computer.
==Links==
2,541
edits