CPCWiki forum

General Category => Technical Support - Software related => Topic started by: AMSDOS on 12:05, 02 January 15

Title: Loading mp3 audio files.
Post by: AMSDOS on 12:05, 02 January 15
I was able to load a mp3 on my 6128 a few times using the 320kbps, without too many hassles, though I've had one "Read Error B" occur recently and was wondering if the readability will degrade?  ???
Title: Re: Loading mp3 audio files.
Post by: sigh on 12:49, 02 January 15
How did you achieve this? Do you have an example so we can here how it sounds?

It would be great if you tried classical music as they have alot of various sound ranges, so it would be interesting to hear how that translates to the AY.
Title: Re: Loading mp3 audio files.
Post by: McKlain on 13:44, 02 January 15
You are talking about loading tape images converted to audio on mp3 format, right?
Title: Re: Loading mp3 audio files.
Post by: TotO on 14:45, 02 January 15
I expect too!  ;D
Title: Re: Loading mp3 audio files.
Post by: ralferoo on 19:46, 02 January 15
Firstly, I'd strongly advise against mp3. The MP3 encoding process gets rid of frequencies that the human ear has difficulty hearing and sometimes that will include frequencies in the range that computer data will be recorded in.

And at 320kbps, you might as well use 1-channel 8-bit WAV at 44100Hz, which would be a similar size and actually far better for computer data.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 22:03, 02 January 15
Ok, so I initially had a CDT file, converted that to WAV using TAPE2WAV which gives me that 1-channel 8-bit WAV at 44100Hz @ralferoo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=476) mentions and then I made it mp3 using Lame/Audacity.
When I created the mp3, the software asks me which version to use, there's more compatible v1 & more flexible v2, in this instance I went on compatibility, it also has information concerning it's title and any other details about the file itself, along with a pop down box for Genre. It probably doesn't matter what's in that box, but I selected  Other, just in case it wanted to play around with the tone.



I also had to do some editing. The first mp3 I created was loading fine up until the end of the 5th block of the program, when I got a Read Error A. I didn't have this problem when the file was in WAV format, but what happens when TAPE2WAV does it's job, the last block of the program ends abruptly, I simply copied some of that silence, lined up my cursor to the end of the last block (which displays itself as a solid block), and pasted it there to get the file loading on my 6128.


I also mention a Read Error B, which results when Data hasn't been correctly received to the computer, unfortunately I don't know if it's the result of some mp3 degeneration which the human ear could not pick up, or if it was because I was moving a monitor (with interference on it) towards the reader. Once I moved the monitor back to where it was, the file was loading fine again though. I just didn't want to find out that I could make all these mp3s and then they become unreadable. I since found out the interference from the monitor was coming from my disk drives.
Title: Re: Loading mp3 audio files.
Post by: Token on 23:34, 02 January 15
I have some WAV's made from OTLA (8-bit mono 44.1) and a 2 Mo file compress to 84K. (ZIP)


Did you tried to reduce the signal, like -0.5 dB. Maybe the MP3 expect something accurate or it will create artifacts.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 00:38, 03 January 15

Quote from: Token on 23:34, 02 January 15
I have some WAV's made from OTLA (8-bit mono 44.1) and a 2 Mo file compress to 84K. (ZIP)


Did you tried to reduce the signal, like -0.5 dB. Maybe the MP3 expect something accurate or it will create artifacts.


Haven't reduced the signal or anything like that. Ok I edited the mp3 so the last block didn't come to an abrupt ending, which worked.   I just used the process I mention above to generate the appropriate mp3. Unfortunately I'm unfamiliar with OTLA and was unable to find the appropriate program. The program I used TAPE2WAV I got from World of Spectrum can handle CDTs, CSWs & a few other of those Tape Images and create a WAV.


To get the file loading on my CPC, I'm using a DVD player to feed the sound through to, unfortunately I brought the cheaper DVD player which only plays back mp3 or wma  :o  Had I spent a few more dollars, I could of played WAV files without hassle.
Title: Re: Loading mp3 audio files.
Post by: Token on 01:24, 03 January 15
I also made some MP3, I didn't have any problem with but it's best to avoid lossy compression.


The MP3 is a little louder than the original audio. Noise is added. If there's a peak at -2 dB the MP3 will peak arround -0,5dB. And arround 0dB there's some distortion. Clipping that is hard to hear but that could be bad for the datas.
Title: Re: Loading mp3 audio files.
Post by: Token on 01:32, 03 January 15
Otla:
Downloads - otla - Tool for loading programs into vintage computers via their (https://code.google.com/p/otla/downloads/list)


I mainly used it with snaphots and it takes less than 30s to load on my 464 (I did a little soldering to avoid tape head, direct line input)
I converted few stand alone files packed with exomizer, Boulderdash loaded in 11s  ;D
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 02:11, 03 January 15
Quote from: Token on 01:24, 03 January 15
I also made some MP3, I didn't have any problem with but it's best to avoid lossy compression.


Unsure if lossy compression has been applied, is there a way of telling? I was just assuming that if the audio was at 320kbps, no compression is being applied, the resulting mp3 is nearly the size of the WAV file.

QuoteThe MP3 is a little louder than the original audio. Noise is added. If there's a peak at -2 dB the MP3 will peak arround -0,5dB. And arround 0dB there's some distortion. Clipping that is hard to hear but that could be bad for the datas.


It didn't appear to be a problem, TAPE2WAV seems to produce a low but solid, though I could check it out in Audacity to see if anything has changed. When I play the sound through my 6128 it sounds soft in the same manner as to when I was loading audio CDs.



Quote
Otla:
Downloads - otla - Tool for loading programs into vintage computers via their (https://code.google.com/p/otla/downloads/list)&


I mainly used it with snaphots and it takes less than 30s to load on my 464 (I did a little soldering to avoid tape head, direct line input)
I converted few stand alone files packed with exomizer, Boulderdash loaded in 11s  ;D


I've only been playing around with Speed Write 1. I was experimenting in CPCE and producing CSW file with 3500/3600 Baud Rate (using an old Type-in from AA & JL-Copy), and using TAPE2WAV & reading it back in Winape, but Read Errors seem to be creeping in with it. I wasn't able to determine what the problem was, but it looked as if the Emulator wasn't receiving the information in time to process, probably due to the lag of my computer occasionally messing up the timing of the emulator I was guessing. I haven't tried it on the 6128 though.
Title: Re: Loading mp3 audio files.
Post by: Token on 03:25, 03 January 15

You can make a null test (phase inversion, phase cancellation) between the WAV and the MP3. There's at least a modulated noise. If the WAV is badly setted then artifacts are also added. I'm mainly using 320kbps, it's really good. This bit rate is still not a lossless. It's not perfect, the noise can result in brain fatigue (in the mastering world).




Maybe you can check the stats (I don't have Audacity, but other tools)
http://forum.audacityteam.org/viewtopic.php?f=42&t=38134 (http://forum.audacityteam.org/viewtopic.php?f=42&t=38134)
It's not something you'll hear.

Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 08:36, 03 January 15
Quote from: Token on 03:25, 03 January 15
You can make a null test (phase inversion, phase cancellation) between the WAV and the MP3. There's at least a modulated noise. If the WAV is badly setted then artifacts are also added. I'm mainly using 320kbps, it's really good. This bit rate is still not a lossless. It's not perfect, the noise can result in brain fatigue (in the mastering world).




Maybe you can check the stats (I don't have Audacity, but other tools)
http://forum.audacityteam.org/viewtopic.php?f=42&t=38134 (http://forum.audacityteam.org/viewtopic.php?f=42&t=38134)
It's not something you'll hear.


Unsure if this is of any help. I've attached Screenshots from Audacity between the mp3 (top) and wav (below) of Spectrum & Pitch. That reveals that there are slight variations between the mp3 & wav. You will also notice the mp3 has got 32-bit Float as the Sample Rate where's the WAV is 16-Bit. I tested this on my original mp3 and ran into loading problems midway through produced file, seems to work better with 32-Bit float.


I've attached wav & mp3 versions of Worm. Again the mp3 for this program works on my 6128, didn't test the wav in Winape, but suspect it'll work without any hassle.


There there if anyone wants to play around with them.
Title: Re: Loading mp3 audio files.
Post by: McKlain on 09:02, 03 January 15
Do you have an android device that you could use as a player?
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 09:38, 03 January 15
Quote from: McKlain on 09:02, 03 January 15
Do you have an android device that you could use as a player?


DVD Player with USB. To get the audio to the 6128 I have a 2 RCA to 3.5mm Stereo Lead with a 3.5mm Female plug on the end of that which becomes my EAR plug Jack.
Title: Re: Loading mp3 audio files.
Post by: Executioner on 06:16, 06 January 15
Quote from: AMSDOS on 02:11, 03 January 15
I was experimenting in CPCE and producing CSW file with 3500/3600 Baud Rate (using an old Type-in from AA & JL-Copy), and using TAPE2WAV & reading it back in Winape, but Read Errors seem to be creeping in with it. I wasn't able to determine what the problem was, but it looked as if the Emulator wasn't receiving the information in time to process, probably due to the lag of my computer occasionally messing up the timing of the emulator I was guessing. I haven't tried it on the 6128 though.

WinAPE can't get the WAV file (or CDT) out of synch with emulation, it's file reading position is directly affected by the cpu clock cycle count, not the displayed frames per second etc.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 09:14, 06 January 15
Quote from: Executioner on 06:16, 06 January 15
WinAPE can't get the WAV file (or CDT) out of synch with emulation, it's file reading position is directly affected by the cpu clock cycle count, not the displayed frames per second etc.


My old computer seems to have moments when it will affect CPU Clock Cycle, especially when other routines want to kick in. I've removed a number of them because I've retired the computer from the Internet, though could do some more spring cleaning.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 22:50, 09 January 15
Quote from: Token on 01:32, 03 January 15
Otla:
Downloads - otla - Tool for loading programs into vintage computers via their (https://code.google.com/p/otla/downloads/list)


I mainly used it with snaphots and it takes less than 30s to load on my 464 (I did a little soldering to avoid tape head, direct line input)
I converted few stand alone files packed with exomizer, Boulderdash loaded in 11s  ;D


I tried using this program, but I seem to be coming up with Reading Access Violations when I was using the Add Blocks Button when loading the CDT. I'm unable to view the help file because I don't have the Internet on my PC. I downloaded v2.2 twice just to make sure it wasn't my browser, but twice the same problem occurred. It doesn't seem to be working properly cause even the Sample BATMAN.CDT isn't working. I can only guess the problem is emerging because I'm using XP or the original ZIP file is bugged, though I'm unsure.  :(
Title: Re: Loading mp3 audio files.
Post by: ralferoo on 23:53, 09 January 15
Quote from: AMSDOS on 22:03, 02 January 15
Ok, so I initially had a CDT file, converted that to WAV using TAPE2WAV which gives me that 1-channel 8-bit WAV at 44100Hz @ralferoo (http://www.cpcwiki.eu/forum/index.php?action=profile;u=476) mentions and then I made it mp3 using Lame/Audacity.
Don't do the MP3 step at the end. The 8-bit WAV is the best quality output... :)
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 00:23, 10 January 15
Quote from: ralferoo on 23:53, 09 January 15
Don't do the MP3 step at the end. The 8-bit WAV is the best quality output... :)


I'd like to do it like that, unfortunately my setup doesn't support WAV :( 


I'm unsure though where your argument is against mp3, I'm assuming your saying the quality will degrade over time, but you seem to be saying that there's stuff we cannot hear that the computer will pickup. My screen dumps (which I could probably improve), showed differences between wav & mp3, but haven't presented any issues with the end BASIC listing. Binary maybe a different story though, will only know by testing.

I can play CD Sound files through the DVD player, but I don't know if it's possible to produce an Audio file without Burning a CD, I maybe able to playback "cda" through USB, but again I'm unsure.


I've still been able to load my mp3s I produced earlier for the BASIC programs which are recorded in Speed Write 1. I only seem to run into problems when the speed of the program is increased (even on my 6128), so perhaps mp3 is limited to speed write 0 or 1, other loaders may cause problems (headerless/speedlock), I've only kept it to BASIC.



Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 00:39, 10 January 15
I just checked and my DVD player supports WMA, though I think that will be worse for Data files unless someone knows different.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 00:51, 10 January 15
Quote from: AMSDOS on 00:23, 10 January 15

I can play CD Sound files through the DVD player, but I don't know if it's possible to produce an Audio file without Burning a CD, I maybe able to playback "cda" through USB, but again I'm unsure.


Nope, doesn't look like it since cda is only a shortcut to tell the computer where the track is on a CD. This site (http://en.wikipedia.org/wiki/.cda_file) mentions the possibility of programs collecting the audio data for an user to listen to, though there probably aren't too many programs that do that for free I'd imagine.
Title: Re: Loading mp3 audio files.
Post by: ralferoo on 16:31, 10 January 15
Quote from: AMSDOS on 00:23, 10 January 15
I'd like to do it like that, unfortunately my setup doesn't support WAV :( 
You're storing this data on a DVD right? You should be able to record PCM data on the disc as DVD only supports PCM (which will get passed through the DAC and out through the analogue audio sockets) or a "multichannel bitstream" where the format isn't specified and is passed out raw through the optical or coax SPDIF socket.

Quote
I'm unsure though where your argument is against mp3, I'm assuming your saying the quality will degrade over time, but you seem to be saying that there's stuff we cannot hear that the computer will pickup.
It won't degrade over time, it degrades instantly when you convert into MP3 format. MP3 isn't lossless, it's specifically designed to discard frequencies that the human ear can't easily detect, that's how it achieves its good compression results. It's nothing to do with just cutting out high frequencies (although it does that too), it can and will cut out frequencies in the range needed for computer data if it thinks it won't make a audible (to a human) difference.

You can google for "psychoacoustic model" if you want to know more about it, but I really cannot recommend using MP3 for this application whatever quality settings you choose.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 00:08, 11 January 15

I can read an audio CD through the DVD player to my Amstrad, but what I'm doing is using the USB on the DVD and reading the file from an mp3 player or flash drive (saving a hassle of burning a CD for the sake of a file) and it's this player which won't display wav files to select for loading.


I could perhaps try and disguise a wav file with a mp3 extension, but I think I tried this already and found the player simply doesn't support it.


My player also supports avi, wma & divx, though are also forms of compression & a lot harder for me to produce.


I'm not ruling out that mp3 will cause problems, at the moment all I have is 2 BASIC programs which are loading (1 of those I attached on the 1st page), though I'm not exactly using a standard connection to get the sound to my Amstrad which is loading them files normally.
If I was using a mp3 player to get the sound via the Ear plug to the Amstrad then sound quality is poor in that case I doubt the Amstrad could read it properly, but in my case I'm reading the sound through the USB port and converting the Left & Right Audio Output into an Earplug jack and in that case none of the noise gets carried through.


But I can carry out more tests just to see if I find limitations.
Title: Re: Loading mp3 audio files.
Post by: McKlain on 09:03, 11 January 15
If you use foobar2000 you can follow this tutorial: http://www.hydrogenaud.io/forums/index.php?showtopic=47759 (http://www.hydrogenaud.io/forums/index.php?showtopic=47759) to create wma files, wich I think would give better results than m3p files on your player.
Title: Re: Loading mp3 audio files.
Post by: AMSDOS on 08:17, 12 January 15
Quote from: McKlain on 09:03, 11 January 15
If you use foobar2000 you can follow this tutorial: http://www.hydrogenaud.io/forums/index.php?showtopic=47759 (http://www.hydrogenaud.io/forums/index.php?showtopic=47759) to create wma files, wich I think would give better results than m3p files on your player.


I wasn't able to follow those instructions very well, yes I was able to go into Windows Media Player and noticed the WMA Lossess, but couldn't do anything with it from that since it was looking for a Ripping Source via CD, no files. I haven't used foobar2000 either.


So I got an update of Audacity which supports WMA via FFMPEG.


I now have an mp3 and wma of the same program which is using the Firebird Loader. Both running at 320Kbps, the noticeable difference being the filesize, the WMA is much larger.


Loading with mp3:


Initial files load using Speed write 0, occasionally I get "Read Error B" on the Initial file, with a rewind sorting that out. Program seems to load well under the Firebird with the Occasional Error on Block 0E (I think) for the Loading Screen, rewind and play again resolves that (bit like the good ol' days  :D ), rest of the game amazingly loads without Issues with the mp3 and sometimes the program loads without error.  :o  And to think this was the same game that I couldn't load from an "cdt" in Winape, but there are issues with cdt which get resolved when file becomes a wav (not winapes fault  :D ).
I also note that I haven't had any difficulty loading Speed Write 1 programs with mp3, this seems to be the first program which is perhaps making it slightly harder for the Amstrad to read SW0.


Loading with wma:


I don't know what kind of wma I'm dealing with, under the latest Audacity with FFmpeg I can specify 320kbps Bit Rate which was something I couldn't do in the past, which resulted in poor quality wma. To create the file I've gone back to the original wav and saved it as wma, I've only loaded the program half a dozen times, but it appears the sound of the program is clearer and haven't had any errors occur.
Title: Saving mp3 audio files from 6128
Post by: AMSDOS on 08:41, 08 September 15
Quote from: ralferoo on 19:46, 02 January 15
Firstly, I'd strongly advise against mp3. The MP3 encoding process gets rid of frequencies that the human ear has difficulty hearing and sometimes that will include frequencies in the range that computer data will be recorded in.

And at 320kbps, you might as well use 1-channel 8-bit WAV at 44100Hz, which would be a similar size and actually far better for computer data.


I've found out that when I'm saving a program from my 6128 to a digital device, it involves a lot of fiddling on the digital recorder side of things which is very frustrating. Compared to what I was doing earlier (creating CDT/create WAV/create MP3/WMA), it's a pain.
Powered by SMFPacks Menu Editor Mod