English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 17 January 2020, 15:55   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Playing a long running sample...

I have (currently) a 2 minute sound byte that I to sample and convert to be played as part of a scene on the A1200.

Now using this site https://www.colincrawley.com/audio-f...ze-calculator/
i have put in a sample rate of 22Khz, 8 bit depth and 1 mono channel and the file size uncompressed comes out at 2.64mb.

Ideally I have about 750Kb available to the sample so I'm looking at the best ways that I can get it to play on the Amiga.

As I know absolutely nothing about Paula I'm looking for suggestions on the best way to achieve this... my understanding is that Paula will only play a sample of upto 64kb in size.

The first obstacle would be compressing the 2.64mb of data so I was going to slice it up into 64kb packed buckets. About half the clip would be loaded and uncrunched in chip ram, once the first samples start playing I can then stream in the from floppy the remaining buckets and play those.

Is this the right way to go about this or is there a simpler way? If needed I could lower the quality but i'd like to keep it as clear as possible because it is speech over music so clearer the better.

Any help/advice is appreciated.

Geezer
mcgeezer is offline  
Old 17 January 2020, 16:00   #2
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
One small detail: Paula can play up to 128KB in one sample, not 64KB.

As for the method, it may be possible to use simple audio compression forms and still end up real-time. Though AFAIK fast audio compression tends to not be very good in terms of gains (or quality if you use lossy).
roondar is offline  
Old 17 January 2020, 16:04   #3
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
Might want to look at Kalms ADPCM stuff

https://github.com/Kalmalyzer/adpcm-68k
DanScott is offline  
Old 17 January 2020, 16:55   #4
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by roondar View Post
One small detail: Paula can play up to 128KB in one sample, not 64KB.

.
Nice one Roondar, thank's for pointing that out

Quote:
Originally Posted by DanScott View Post
Might want to look at Kalms ADPCM stuff

https://github.com/Kalmalyzer/adpcm-68k
That looks very good, cheers Dan.

Always best to ask the EAB first on stuff like this.

Geezer
mcgeezer is offline  
Old 17 January 2020, 23:31   #5
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
OK so I had a play around with this and I guess it's a bit challenging...

What I'm trying to do is get the audio sample here:
https://www.amigagamedev.com/Downloads/newblack_raw.mp3

which is 2 minutes long to be able to play with decent quality on the Amiga, BUT i need to get the file size down to about 700kb.

So I transcoded the file using sox to both 8Khz and 12Khz...

The 12Khz I would go with but it would mean I have to fit it across two disks, although it would fit in the A1200 chip ram.

the 8Khz version is reduced quality... but still quite large and I don't think they'll compress down to one floppy.

https://www.amigagamedev.com/Downloa...lack_8khz.8svx

https://www.amigagamedev.com/Downloa...ack_12khz.8svx

I tried Kalms utils but all i got was "Fail" when trying to convert the wav's...

Can this be taken to a 1 disk floppy with audio akin to the 12Khz???

Possibly a madman task.
Geezer
mcgeezer is offline  
Old 18 January 2020, 00:11   #6
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
you dont need to play long sample from chip ram.
for handling long sample players on Amiga you can check source players for:
ADPCMmono
NTSP
onEscapee
and from custom modules from Dragons Lair and Space Ace.
All available on the Wanted Team page.
Don_Adan is offline  
Old 18 January 2020, 00:20   #7
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Don_Adan View Post
you dont need to play long sample from chip ram.
for handling long sample players on Amiga you can check source players for:
ADPCMmono
NTSP
onEscapee
and from custom modules from Dragons Lair and Space Ace.
All available on the Wanted Team page.
This implies I would be using another ram type...?
mcgeezer is offline  
Old 18 January 2020, 00:27   #8
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
Quote:
Originally Posted by mcgeezer View Post
This implies I would be using another ram type...?
for very long samples, you must/can use small buff in chip ram. samples are copied/depacked from fast memory to this buffer. or you can use Ready Soft style player, blitter decoding, 4bit quality.
Don_Adan is offline  
Old 18 January 2020, 01:00   #9
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by Don_Adan View Post
for very long samples, you must/can use small buff in chip ram. samples are copied/depacked from fast memory to this buffer. or you can use Ready Soft style player, blitter decoding, 4bit quality.
I don't have any fast ram though.
mcgeezer is offline  
Old 18 January 2020, 01:31   #10
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
A noisy test
Attached Files
File Type: zip PlayAdpcm.zip (691.8 KB, 87 views)
ross is offline  
Old 18 January 2020, 01:43   #11
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
Quote:
Originally Posted by mcgeezer View Post
I don't have any fast ram though.
Decoding from chip ram to chip ram can be not very good for 68020+. But i dont know how many CPU time you have. If I remember right for pure chip ram sample playing you can use replay from AfterBurner custom module.over 400kB sample, if I remember right. Or maybe from CarrierCommand? I forget, it was Dave Lowe music. He used two versions for sample type playing. Pure one sample only and splitted for more samples version.
Don_Adan is offline  
Old 18 January 2020, 03:21   #12
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
I dont know how many chip ram free you have for sampled music, but you can use ADPCM (rate 1:2, if I remember right) or NTSP (rate 5:9). Or simple pack sample with PackFire (LZMA) or Arj7, and depack to chip ram. If you want to use only one disk for sampled music, your packed (ADPCM, NTSP, LZMA,ARJ7) file can be maximum 901120 bytes long or ~1.1MB if you used longtrack MFM format.
Don_Adan is offline  
Old 18 January 2020, 10:29   #13
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
A noisy test
Any chance you could let me in on how you did that buddy?

I wasn't able to get adpcm to work that Dan linked above.
mcgeezer is offline  
Old 18 January 2020, 11:16   #14
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by mcgeezer View Post
Any chance you could let me in on how you did that buddy?

I wasn't able to get adpcm to work that Dan linked above.
It was thrown in a few minutes last night, so I don't even know if I did everything right

For the encoding phase: sox.
I've set a frequency for an Amiga PER=300, with a low pass filter at 6Khz and dither.
Sure some better filter and tests be needed.

Then I've assembled PlayAdpcm from Kalms's package.
Probably the exe from Kalms's encoder need a recompilation because do not work on today Win machines.


EDIT:
Ok, now I'm in the laptop where I launched the encoding stage.
Note: it's absolutely not a series of recommended filters, they are simply the first thing that came to my mind and that could give 'decent' results, certainly it can be improved, we can discuss of this.

sox command line used:
sox.exe -v 0.92 -S -V -D "newblack_raw.mp3" "newblack_raw.ima" remix - lowpass 6000 rate -v -s -I 11822 dither -S


Results:
Code:
Level adjust   : 0.92 (linear gain)
Channels       : 1
Sample Rate    : 11822
Precision      : 13-bit
Sample Encoding: 4-bit IMA ADPCM
effects chain:
 input        44100Hz  2 channels
 remix        44100Hz  1 channels
 lowpass      44100Hz  1 channels
 rate         11822Hz  1 channels
 dither       11822Hz  1 channels
 output       11822Hz  1 channels
Done.

Last edited by ross; 18 January 2020 at 14:05. Reason: sox
ross is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
ST-08 sample disk Dionysis request.Apps 7 15 October 2021 12:57
well get old cd tv up and running long with new amiga 1200 mcbone Amiga scene 0 05 July 2013 20:23
Towers (Warning, long shot and long post) Drake1009 Looking for a game name ? 2 13 May 2005 00:11
A very long, LONG shot... staticgerbil Coders. General 0 13 April 2003 11:18

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:55.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11839 seconds with 16 queries