DCEmulation

The Dreamcast Homebrew Community Online
It is currently Thu May 23, 2013 11:10 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Wed Jan 04, 2012 6:53 pm 
Offline
DC Developer
DC Developer
User avatar

Joined: Fri Jun 18, 2010 7:29 pm
Posts: 261
LibADX - A Dreamcast K:OS ADX Decoding Library

Quote:
LibADX (c)2012 Josh PH3NOM Pearson
decoder algorithm based on adx2wav (c) BERO 2001

LibADX is a library for decoding ADX audio files using the
Kallisti:OS development environment, intended for use only
on the Sega Dreamcast game console.

LibADX features full implementation of the ADX looping function.
The functions available include play, pause, stop, restart.

This library is completely free to modify and or redistribute.

LibADX is a static library, build the library with the makefile:
LibADX/LibADX/Makefile

Then build the example player:
LibADX/Makefile

The example player uses a hard-coded file name, so make sure
to include a "sample.adx" on the root of the /cd/, or modify
the source libADXplay.c to load a different file.


Attachments:
File comment: LibADX v.0.1 - A Dreamcast ADX Library for KOS
LibADX.tar.gz [6.64 KiB]
Downloaded 51 times


Last edited by PH3NOM on Mon Feb 13, 2012 10:09 pm, edited 1 time in total.
Top
 Profile  
 
PostPosted: Thu Jan 05, 2012 9:12 pm 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 3582
Just to let you know, PH3NOM, you're more than welcome to upload any Dreamcast-related stuff as an attachment on a post here, and I'd encourage you to do so. It'd probably be a good idea too, just in case the files were to get deleted from megaupload or something like that. It'd be a shame to lose stuff due to that kind of thing happening.

Also, just as a minor nit-pick, there's no : in KallistiOS or in its abbreviation. :wink:


Top
 Profile  
 
PostPosted: Wed Jan 11, 2012 2:57 am 
Offline
Insane DCEmu
Insane DCEmu
User avatar

Joined: Wed Apr 09, 2008 7:04 am
Posts: 178
Location: Europe
Thank you, i read someone was asking for it.
Is there a legal way to encode to adx ?

_________________
Order Fast Striker, GunLord and NEO XYX for Dreamcast at http://www.ngdevdirect.com
Order 2d/3d Shoot 'em up Sturmwind http://www.redspotgames.com/shop
Order Dux 1.0, Redux incl. Dux 1.5 and The Ghost Blade at http://hucast.com/index.php


Top
 Profile  
 
PostPosted: Wed Jan 11, 2012 4:59 pm 
Offline
DCEmu Ex-Mod
DCEmu Ex-Mod
User avatar

Joined: Sun Nov 04, 2001 4:12 pm
Posts: 3519
Location: Hell, Brazil
Haven't looked at it, but I guess it runs on the SH4. Did the official games use the sound processor for decoding ADX files?

_________________
Makaqu engine blog / website.
Image
⇈ ⇊ ⇆ ⇆ B A Start


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 8:46 am 
Offline
DC Developer
DC Developer
User avatar

Joined: Fri Jun 18, 2010 7:29 pm
Posts: 261
Basil wrote:
Thank you, i read someone was asking for it.
Is there a legal way to encode to adx ?


FFMpeg should handle that just fine.
Although, looking at the source, that encoder does not support encoding loop information.

mankrip wrote:
Haven't looked at it, but I guess it runs on the SH4. Did the official games use the sound processor for decoding ADX files?


The ADX decoder consumes 1% of the Dreamcast's CPU.
http://www.segatech.com/technical/critools/index.html

I think the hard part with decoding ADX on the AICA would be streaming the encoded samples to the AICA.
It would be easy to upload an entire ADX to SRAM then decode it, but most ADX's will be to big to fit into SRAM, so it would need to be streamed somehow.
If anyone has some ideas on how to make this work, I would be interested to hear.


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 1:07 pm 
Offline
Insane DCEmu
Insane DCEmu
User avatar

Joined: Wed Apr 09, 2008 7:04 am
Posts: 178
Location: Europe
Quote:
FFMpeg should handle that just fine.

Can you give me a tutorial ?

_________________
Order Fast Striker, GunLord and NEO XYX for Dreamcast at http://www.ngdevdirect.com
Order 2d/3d Shoot 'em up Sturmwind http://www.redspotgames.com/shop
Order Dux 1.0, Redux incl. Dux 1.5 and The Ghost Blade at http://hucast.com/index.php


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 2:57 pm 
Offline
Insane DCEmu
Insane DCEmu
User avatar

Joined: Sat Dec 01, 2007 7:51 am
Posts: 270
Wow, now that is a sserious surprise.
This might end some issues with audio formats.

Hum one question, when this is loaded, does it take over the whole sound system or is it possible to load any other formats through other libs ?


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 6:56 pm 
Offline
DC Developer
DC Developer

Joined: Thu Aug 20, 2009 9:00 am
Posts: 316
Basil wrote:
Quote:
FFMpeg should handle that just fine.

Can you give me a tutorial ?


From a terminal

Code:
ffmpeg -i input.wav -acodec adpcm_adx output.wav


That will take an input wav and encode it as ADX and store it in a wav file. The input file can be a bunch of different formats... whatever ffmpeg is capable of decoding, be it ogg or mp3 or plain pcm. The output should be stored in a wav file - the header will have the compression type set in it. That is the simplest form of transcoding, and will have the same settings as the input file - if the input was mono and 44kHz, so will the output. If the input was 22kHz and stereo, so will the output.

To change the audio before encoding, you can use filters in ffmpeg, or a completely different app to pipe the data to ffmpeg. Here's how you use sox to pipe data to ffmpeg

Code:
sox -v 0.90 BadAppleEn.ogg -t wav -c 2 -r 22050 - | ffmpeg -i - -acodec adpcm_adx output.wav


That will have sox decode BadAppleEn.ogg into a wav at 90% volume with two channels and 22kHz sample rate that will be piped into ffmpeg which will then encode it to a wav with ADX encoding. If you needed it to be 8kHz mono 8-bit, you would do

Code:
sox -v 0.90 BadAppleEn.ogg -t wav -c 1 -r 8000 -b 8 - | ffmpeg -i - -acodec adpcm_adx output.wav


EDIT: Found an issue with my instructions... you can't actually store an ADX stream in a wave. Weird, but ffmpeg won't do that. In fact, I'm having trouble finding an output format that WILL store an ADX stream. What good is ADX encoding if you can't save the encoded data? It won't even save it as raw data. :|

EDIT 2: Couldn't find anything on saving the output of ffmpeg when encoding as ADX. I guess for now it's wav2adx or nothing. :cry:


Top
 Profile  
 
PostPosted: Fri Jan 27, 2012 9:44 pm 
Offline
DC Developer
DC Developer
User avatar

Joined: Fri Jun 18, 2010 7:29 pm
Posts: 261
BlueCrab wrote:
Just to let you know, PH3NOM, you're more than welcome to upload any Dreamcast-related stuff as an attachment on a post here, and I'd encourage you to do so. It'd probably be a good idea too, just in case the files were to get deleted from megaupload or something like that. It'd be a shame to lose stuff due to that kind of thing happening.

Also, just as a minor nit-pick, there's no : in KallistiOS or in its abbreviation. :wink:


Funny, I thought I saw it abbreviated as K:OS somewhere...

And, stupid question; Now that megaupload is in limbo, how exactly to I upload files as attachments here?


Top
 Profile  
 
PostPosted: Sat Jan 28, 2012 12:05 am 
Offline
The Crabby Overlord
The Crabby Overlord
User avatar

Joined: Mon May 27, 2002 9:31 am
Posts: 3582
PH3NOM wrote:
BlueCrab wrote:
Just to let you know, PH3NOM, you're more than welcome to upload any Dreamcast-related stuff as an attachment on a post here, and I'd encourage you to do so. It'd probably be a good idea too, just in case the files were to get deleted from megaupload or something like that. It'd be a shame to lose stuff due to that kind of thing happening.

Also, just as a minor nit-pick, there's no : in KallistiOS or in its abbreviation. :wink:


Funny, I thought I saw it abbreviated as K:OS somewhere...

And, stupid question; Now that megaupload is in limbo, how exactly to I upload files as attachments here?
You have to use the full "Post a reply" or "New topic" page to see the option, not the quick reply box at the bottom of the thread. Once you're on the full post editor, you should see a box labeled "Upload attachment" right underneath the Preview/Submit/Save/Cancel buttons. Pick your file, hit the add a file button, and you should be good to go.

You also should be able to upload an attachment if you just edit a post as well. The upload box should be in the same place.

If you don't see it, let me know, and I'll figure out why its not showing up.


Top
 Profile  
 
PostPosted: Mon Feb 13, 2012 11:53 am 
Offline
Insane DCEmu
Insane DCEmu

Joined: Thu Apr 03, 2008 5:01 am
Posts: 113
Could you re-upload it plz?


Top
 Profile  
 
PostPosted: Mon Feb 13, 2012 10:10 pm 
Offline
DC Developer
DC Developer
User avatar

Joined: Fri Jun 18, 2010 7:29 pm
Posts: 261
Ayla wrote:
Could you re-upload it plz?


Original post updated with attachment...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: patbier and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group