Welcome, Guest. Please login or register.

Author Topic: Amiga sound playback routine/format questions  (Read 3967 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline amigaksi

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 827
    • Show all replies
    • http://www.krishnasoft.com
Re: Amiga sound playback routine/format questions
« on: August 10, 2010, 04:52:32 AM »
Regarding 8-bit sample decompression, I did that on stock 7.16Mhz Amiga using lossless delta-modulation followed by Huffman encoding.  You can even use Arithmetic encoding to get around 3:1 lossless compression.  Currently, I am just uploading decompressed data from the floppy drive port (from PC) into a queue on Amiga end and I'm easily able to update the queue using 11.025Khz audio and have text/imagery also being uploaded at the same time.
--------
Use PC peripherals with your amiga: http://www.mpdos.com
 

Offline amigaksi

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 827
    • Show all replies
    • http://www.krishnasoft.com
Re: Amiga sound playback routine/format questions
« Reply #1 on: August 10, 2010, 04:24:12 PM »
Quote from: bubblebobble;574149
@bloodline

You forgot to mention that the lower byte has to be shifted down 2 bits. This is where the 14bit comes into play. 64 is only 2^6. If they had made the volume control with a granulariy of 256 instead of 64, you could get 16bit playback.

Looseless goes not beyond 1:2 compression. But lossy ADPCM is cheaper to decode and at 8bit sounds pretty good (I cant hear a difference with HQ equipment). It still sounds acceptable at 4bit, but high frequencies get a little rough though.

We had this discussion once already:

PCM 16bit
ADPCM 8bit
ADPCM 4bit
ADPCM 2bit

Those are all plain .wav files, but have been encoded&decoded.


I am not a fan of lossy algorithms including MPEG, JPEG, MP3, etc.  I rather know exactly what I'm losing every sample rather than some sort of probability distribution where some samples may lose a lot more bits than others.  It doesn't matter how it sounds to some particular person since that's subjective.  Yeah, I do get 3.3:1 compression in my Gita multimedia CD (available on my website).  I compressed 2GB of 11Khz 8-bit samples losslessly to 600MB so they fit on one CD along with images.  It depends on the algorithm and audio data and rate.  I can probably get higher compression at higher sampling rates since redundancies increase.  Some people think MP3 sounds just like uncompressed digital audio CDs, but objectively speaking, the uncompressed is higher quality.
--------
Use PC peripherals with your amiga: http://www.mpdos.com
 

Offline amigaksi

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 827
    • Show all replies
    • http://www.krishnasoft.com
Re: Amiga sound playback routine/format questions
« Reply #2 on: August 11, 2010, 02:56:10 AM »
Quote from: bubblebobble;574202
> Yeah, I do get 3.3:1 compression in my Gita multimedia CD
This is probably due so relatively silent parts in the samples and/or the 8bit quantisation.
Try the same on some randrom music in 16bit. In average, you wont get better than 1:2 when you go loosless.
http://wiki.hydrogenaudio.org/index.php?title=Lossless_comparison

And Amiga_Nut needs something fast enough for a nacked A500 that should do some GFX in the meanwhile.


Thanks for that link-- I didn't realize my link was also in that article: http://www.krishnasoft.com/sps.htm.  I never promoted my audio software but I guess someone did it for me.  I did say 8-bit in my post #5 and it does work on stock Amiga at 7.16Mhz as the decompressor is very fast (faster than playback rate).  All speech and even some music have silent parts; it's part of natural sentence structure.  But even the silence is noisy in my audio as it was digitized from cassettes and there's that "hiss" type of noise when someone pauses between words.
--------
Use PC peripherals with your amiga: http://www.mpdos.com
 

Offline amigaksi

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 827
    • Show all replies
    • http://www.krishnasoft.com
Re: Amiga sound playback routine/format questions
« Reply #3 on: August 11, 2010, 03:00:54 AM »
Quote from: bubblebobble;574207
If Paula is a 14bit DA Converter, what is the "calibration" for then?

As for th downsampling, this is another story, but can be done "offline". I used to do 44.1kHz with interrupt, but on a 68060.
With dithering I mean to reduce (or better mask, it is some kind of noise shaping) the audible quantisation noise. Just like dithering in images with low bit depth.


I think the logic is that if it's not a linear 14-bit DAC then a table helps to map 16-bit data to the nonlinear 14-bits optimally rather than approximate with LSR.W #2,D0.
--------
Use PC peripherals with your amiga: http://www.mpdos.com