41

My ZX Spectrum 48k seems very resistant to working with audio input. I no longer have any cassette players, so am relying on audio files from digital players. I have been able to save and verify a tiny BASIC program to a digital recorder, but getting the right volume to save files from playtzx or OTLA is eluding me.

Things I've tried:

  • TeeZiX - TZX/TAP player on my phone
  • Many different audio cables, mono, stereo and TRRS
  • Edirol R-1 digital recorder/player (this is the one I got the save and verify to work on, and it has good input/output volume control)
  • a Sandisk Sansa player running Rockbox
  • an 800 Hz square wave tone at 0 dB to see if I could trigger the record level and make the screen border flicker. (summary: nope)
  • Audio files from tape2wav/PlayTZX and otla (via wine).

What else should I try?

9
  • You are using the EAR input on your Spectrum, aren't you? Jun 7, 2016 at 15:30
  • 1
    Yes, but thanks for asking. The Sinclair's EAR ↔ EAR and MIC ↔ MIC (but never both at the same time) is different from RX ↔ TX I typically do with null modems.
    – scruss
    Jun 7, 2016 at 16:21
  • Try using DivIDE device -- while not a sound player, it effectively emulates tape loading calls and makes loading faaast.
    – lvd
    Mar 27, 2017 at 11:07
  • But it's not an audio solution, @lvd — and that's what I was asking about. I have a Retroleum SMART card that does fast loading of snapshots
    – scruss
    Mar 27, 2017 at 14:39
  • 2
    Newest developments: TZX Duino and Arduitape (Google for them) are Arduino-based devices that can play TZX files as audio into the Spectrum. They are kind of new in summer 2017.
    – tofro
    Jun 28, 2017 at 6:27

5 Answers 5

48

If (and only if) your audio player is battery powered, and your Spectrum is the 48K or 128K toastrack model, try the following procedure, intended to boost the volume of your wave signal, as seen by the Spectrum EAR circuitry:

  • Get one of these audio cables. They are very common. And yes, they are stereo.

enter image description here

Why do we need it to be stereo? The trick is that both channels from the 3.5'' stereo plug will make contact inside the Spectrum jack this way:

enter image description here

So when you use it to load from a digital audio player, that will normally output the same level in both channels, you won't hear (or load) anything.

Then what? Just invert one of the channels so the voltage level of one channel, reffered to the other channel, will appear to be double the value of any of both channel reffered to ground (which won't be connected at all in our setup)

If the TAP/TZX conversion program allows this inversion, use it. If not, you can use an editor program like Audacity to perform the inversion. Here is how:

First, load your generated WAV into Audacity. The generated WAV should be stereo, but if not, it doesn't matter. We can clone one channel to the other one to make it stereo.

enter image description here

Use the magnifier tool inside the wave window to amgnify it to the point you can clearly see both waves, that initially will look the same.

enter image description here

Now click on the wav name tab and select "Split stereo track"

enter image description here

Now we have the left and right channels in different tracks, so we can manipulate each one independently.

Change to the select tool (above the magnifier tool) and click the second track (the one below the other) as near as possible to the beginning of it. Press Home to bring the selection mark to the very beginning of the track. From the menu, select Edit -> Select -> Cursor to Track End so the whole track is selected.

enter image description here

With that selection active, select Effect -> Invert

enter image description here

Now we have two independent tracks, one of them with an inverted version of the sound of the other one.

enter image description here

Now select both tracks: press Shift and click on both tracks (the region where the properties of each track are displayed). Then, click on the name of any of them and select "Make stereo track"

enter image description here

The final result should be a stereo track with one channel inverted.

enter image description here

Save this wave as PCM stereo track by choosing File -> Export

enter image description here

And then, WAV

enter image description here

Copy it to your digital audio player and use the stereo cable as described to play the resulting sound. Don't be surprised if you need to lower the volume in order to get it loaded.

For example, in order to load this Bruce Lee example with a Samsung Onyx, I had to do it using the MIC input on the Spectrum, as the EAR input was too loud to be usable.

enter image description here

13
  • 4
    Somewhat to my surprise, that worked rather well. Thank you! I'll add a sox script to this page to do the same as your very well explained Audacity method.
    – scruss
    Jun 7, 2016 at 21:30
  • 3
    What a fantastic answer. Both in terms of the actual answer, and in terms of the effort you made to present and explain the answer. Awesome work!
    – robsoft
    Jul 28, 2016 at 20:39
  • 7
    Why "IF YOUR AUDIO PLAYER IS BATTERY POWERED ONLY"??? Thanks
    – Sewa
    Mar 23, 2017 at 3:43
  • 2
    If the audio player and the computer share a common ground — as they would if they were mains powered — there would no longer be the differential voltage range of +0 → +2×Vₛ.
    – scruss
    Mar 23, 2017 at 12:52
  • 3
    What is the purpose of all this? To effectively double the volume without adding distortion? In other words, why would a tape player work while an audio player wouldn't? Mar 24, 2017 at 0:00
20

I've confirmed that mcleod_ideafix's method is reliable for regular tape images. Here is a shell script to do (effectively) the same thing:

#!/bin/bash
# wav2differential.sh - convert mono game tape audio to 2× stereo
# usage:   wav2differential.sh infile.wav
#          (creates  infile-differential.wav)
# scruss - 2016-06-07
# method by ‘mcleod_ideafix’; many thanks / greetz
#   — https://retrocomputing.stackexchange.com/a/774/439

base="${1%.wav}"
sox -q --norm=-3 "$1" -b 16 "${base}-n.wav"
sox -q  "${base}-n.wav" "${base}-ni.wav" vol -1.0
sox -q  --norm=-0.1 -M -c 1 "${base}-n.wav" -c 1 "${base}-ni.wav" "${base}-differential.wav"
rm -f  "${base}-n.wav" "${base}-ni.wav"

Ultimately I'd like to encode these as MP3s, tag them properly, and add loading screens as cover art. But that can come later.

What this script does — for people who might want to port it to systems without the Bash shell. Assume the script has been called with an argument game.wav, a mono audio file of the game loader:

  1. set the variable base to the value game; that is, the base name of the file argument, stripped of its file extension. I'll assume that the variable has been substituted from here on

  2. create a temporary mono audio file game-n.wav from game.wav with the volume set to -3 dB (--norm=-3) with 16-bit samples (-b 16)

  3. create a temporary mono audio file game-ni.wav from game-n.wav with the samples inverted (vol -1.0)

  4. merge (-M) the two mono temporary files game-n.wav and game-ni.wav into a stereo output file game-differential.wav, correcting the peak volume to be -0.1 dB, or just below clipping (--norm=-0.1)

  5. remove the temporary files game-n.wav and game-ni.wav

The -q sox option I used throughout is just to make sox quiet: it tends to create lots of text output that you don't really need.

4
  • 7
    For MP3, encode them as stereo (not joint stereo) and 128 kbps or more. Jun 8, 2016 at 17:06
  • Dear @scruss can you give me more details (if and) how can I use this script in Windows? (I have SOX installed of course). Thanx
    – PanosPlat
    Nov 20, 2017 at 9:19
  • 1
    Sorry, @PanosPlat, I don't know anything about Windows scripting, but I'll add something to my answer so you can see what it does to port it
    – scruss
    Nov 20, 2017 at 13:43
  • Thank you very much @scruss! If I achieve anything, I ll post it here.
    – PanosPlat
    Nov 21, 2017 at 9:39
1

You could try to start using ZX Tape Player application:

  • Android version
  • iOS version, can be installed using TestFight
  • The Source Code of the app, welcome to contribution! ;)

Enjoy! ;)

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

1
  • Cool idea. It might be fair to disclose your involvement.
    – Raffzahn
    Apr 1, 2022 at 23:59
0

I also had problems getting my PC to work with OTLA on my 48+ model. What I did was play the .wav file through Video Lan Player (VLC) on full blast (125%) and it worked!

I used a stereo to split channel lead using phono to jack adaptors (basically green line in to red/white phono audio connections). I'm sure there's an easier way but this is the way that worked for me.

2
  • Welcome to Retro SE! Why did you decide to physically split the cable? Couldn't you simply mute one channel in VLC to achieve the same effect?
    – nabulator
    Jul 22, 2018 at 4:09
  • By the way, 125% isn't full, so you might get some distortion (floating point rounding errors, clipping) if you do that. Probably nothing that a system / emulated system wouldn't be able to deal with, but still...
    – wizzwizz4
    Jul 22, 2018 at 8:24
-3

You don't have to do all this to load games into ZX Spectrum! The main thing is that your audio player has low output signal, so it just can't do the job.

You must play audio files on PC, but only rear speaker output, because you can burn front headphone output! Also, any amplifier is OK.

Audio files must be in WAV format. Absolutely no tuning and recompressing needed.

Don't use mp3 format to save space, because it can never be perfect as WAV.

Everything is explained in my Youtube video:

https://youtu.be/iD1_HRhXIyc

ZX Spectrum loading games

6
  • 3
    PC rear speaker output — where's that on my laptop? Consider it likely that not everyone has the same hardware (or software) as you. Cassettes (and desktop PCs, up to a point) were commodity items, and now they're not. You should probably also say that this is your video. It doesn't say much more than the text you put in your post.
    – scruss
    Apr 9, 2020 at 12:16
  • 1
    The format of the files - WAV, MP3, MIDI, etc - is irrelevant. The output required is analogue. To agree with Scruss, none of my PCs have more than out audio output port, so suggesting one is better than another is irrelevant.
    – Chenmunka
    Apr 9, 2020 at 14:54
  • Scruss, PC rear means the back of the PC. [trimmed] Also, I specified in video that you can't use laptop. [trimmed] My name is at the end of video, not hidden. Chenmunka, Play WAV and you got analogue, relevant enough. If you have one output, it's amplified. [trimmed]
    – Sasha381
    Apr 9, 2020 at 19:16
  • 1
    I asked this question. I think I pretty much know what answers are helpful or not. As the site says: Be nice, and check out our Code of Conduct.
    – scruss
    Apr 9, 2020 at 21:01
  • 1
    @Sasha381 Your answer isn't very clear, and your comment come sacross as quite abrasive. Plus, we do have a disclosure requirement when you're linking to your own resources; you have to say in the answer that it's yours, not just in the video. (And laptops don't have a PC rear, but can be used for this purpose.)
    – wizzwizz4
    Apr 10, 2020 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .