![]() |
![]() |
#1 |
Registered User
![]() Join Date: May 2022
Location: Adelaide
Posts: 111
|
Best compressed audio?
I'm trying to fit a 3 minute song onto a floppy disk, the best format I've discovered so far is AMR, which has low quality but wonderful amounts of compression. I have several questions:
Thanks in advance. |
![]() |
![]() |
#2 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 802
|
What quality is your input audio and what's the desired output frequency and bit depth? Mono, stereo?
I assume you've done some benchmarks with AMR, what kind of results did you get regarding size and quality? |
![]() |
![]() |
#3 | |
Registered User
![]() Join Date: May 2022
Location: Adelaide
Posts: 111
|
Quote:
AMR narrowband is locked at 8000Hz, and broad band is non-distributable. I'll settle for 8000Hz minimum, any number of bits I can't hear the difference. It must be able to decode in real time, preferable stream able off of disk. |
|
![]() |
![]() |
#4 |
ex. demoscener "Bigmama"
![]() Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,479
|
|
![]() |
![]() |
#5 |
Registered User
![]() Join Date: May 2022
Location: Adelaide
Posts: 111
|
That sounds like tracker music. I'm converting an MP3 song to fit on a floppy disk, and to be usable by a stock A500. It has lyrics, so I can't just convert it to tracker music.
|
![]() |
![]() |
#6 |
Registered User
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 802
|
|
![]() |
![]() |
#7 |
Registered User
![]() Join Date: Apr 2019
Location: UK
Posts: 519
|
Second half has lyrics.
|
![]() |
![]() |
#8 |
Registered User
![]() Join Date: May 2022
Location: Adelaide
Posts: 111
|
Oh right, didn't watch that far.
|
![]() |
![]() |
#9 |
Registered User
![]() Join Date: Feb 2018
Location: Poland
Posts: 314
|
There is another one
[ Show youtube player ]
|
![]() |
![]() |
#10 | |
Registered User
![]() Join Date: Jun 2022
Location: Amalfi Coast / Italy
Posts: 35
|
Quote:
I think that instead, for an unexpanded AMIGA (AMR might be too much for a 68000 afaik), you could try 8SVX at 8000hz mono. it would be something like 64kbps per second of PCM audio (on an AMIGA formatted floppy is approx 1 minute and 40 seconds of audio) |
|
![]() |
![]() |
#11 |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 54
Posts: 1,580
|
For Amiga sample it can be 50% compression, i dont know if AMR did it better.
|
![]() |
![]() |
#12 |
Registered User
Join Date: Jun 2010
Location: PL
Posts: 2,304
|
I would check some open source codecs as Speex and/or Opus (SILK) they should outperform closed and proprietary AMR - but honestly doubt if you can do something useful on plain MC68000 @7MHz with all normal codecs - maybe some heavily stripped and simplified MPEG 1 Layer I. Or perhaps some INT decoders as Tremor for Vorbis or Helix for MP3 but still >>onslaught<< seem to be best in terms quality/compression/CPU utilization.
ADPCM may be sane approach - giving compression 4 or more... ![]() |
![]() |
![]() |
#13 |
Registered User
Join Date: May 2020
Location: Germany
Posts: 20
|
If the AMR you mean is this one https://en.wikipedia.org/wiki/Adapti...te_audio_codec
then I think this decoder can't run in realtime on the 7 MHz 68000. Also, that's a narrow-band speech codec so I expect the music quality to be seriously degraded. IMO a reasonable approach can be: - reduce the sample rate as much as possible, while still getting acceptable audio quality (for example 8 kHz or lower) - use an ADPCM codec to compress the audio data to 4 bits per sample (50% reduction) You can find a ready-to-use ADPCM codec implementation by Mikael Kalms here: https://github.com/Kalmalyzer/adpcm-68k example: 3 minutes, 8 kHz mono, 4-bit ADPCM would fit on a single floppy disk 180s * 8000/s * 4b = 5.760.000b = 703 KiB Last edited by smack; 20 January 2023 at 22:37. |
![]() |
![]() |
#14 |
Registered User
![]() Join Date: May 2022
Location: Adelaide
Posts: 111
|
Thanks for all the help! I've managed to fit it onto the disk as ADCMP, however I was hoping for more than 8Khz, so I'm thinking I'll devise my own simple compression and build it into my program and it will run while it's streaming from disk.
|
![]() |
![]() |
#15 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 50
Posts: 4,808
|
Alternatively you may try XPK lib. Its SQSH method is efficient on samples and fast enough for 68000.
|
![]() |
![]() |
#16 |
Registered User
![]() Join Date: May 2022
Location: Adelaide
Posts: 111
|
|
![]() |
![]() |
#17 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 50
Posts: 4,808
|
It's a compression library with sub-libraries - some of which being specialized for audio.
http://aminet.net/package/util/pack/xpk_User |
![]() |
![]() |
#18 |
Registered User
![]() Join Date: Aug 2022
Location: UK
Posts: 1,770
|
If you want low CPU usage and the ability to pretty much play directly without decompressing the whole thing (or large blocks first), basic 4-bit delta encoding is a good trade off. For the same storage requirements of 8kHz you could use 16kHz. There are different ways to encode the 16 values, I've experimented with quite a few, but you have to be able to encode negative and positive deltas. Also you want to use a nonlinear encoding ideally. Delta value distribution favours small values compared to the original signal. I've also experimented with a zeroless scheme for this (where you can't represent an unchanging value). It's not as limiting for real audio signals as it sounds, but it isn't particularly good on more basic waveforms for reasons that are hopefully self-evident.
For maximum simplicity, you might choose deltas 0, 1, 2, 4, 16, 32, 64, 127, -1, -2, -4, -8, -64. The lack of symmetry is why I experimented with zeroless encoding. Reading a block of delta values and outputting the sample stream is trivial. You just keep track of the current value, get the next 4-bit delta index, look it up in your encoding table above and add it on. That's the next output sample. |
![]() |
![]() |
#19 | |
Registered User
![]() Join Date: Feb 2017
Location: Denmark
Posts: 570
|
Quote:
|
|
![]() |
![]() |
#20 | |
Registered User
![]() Join Date: Aug 2022
Location: UK
Posts: 1,770
|
Quote:
Last edited by Karlos; 21 January 2023 at 23:16. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compressed filelist.txt | jbl007 | project.Amiga File Server | 1 | 11 November 2017 22:54 |
fs-uae and cd32 compressed audio | deejay | support.FS-UAE | 3 | 24 March 2014 20:17 |
ADF file compressed with RAR | pucci | support.WinUAE | 5 | 16 October 2011 12:37 |
Compressed HDF saving | BippyM | request.UAE Wishlist | 5 | 17 October 2005 23:12 |
Multi-Disk Compressed ADF? | TheOutrider | support.WinUAE | 10 | 02 October 2003 10:44 |
|
|