English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 02 May 2014, 20:36   #1
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
new WAV to 8SVX converter for Amiga, MorphOS and Linux

I do not know if i post this to the correct category, please relocate if not.

I've just finished rewriting my WAV to 8SVX converter in C, so i publish it, maybe someone can use it.
The converter can convert any kind of WAV to 8SVX; it supports signed/unsigned 8/16/24/32-bit WAV with any number of channel.
The converter mix the channels to one and resample the wave to signed 8-bit.

Optionally the sampling frequency can be specified (as the third parameter) which can be maximally 65535 Hz (8SVX format does not support higher) and if it was given, then the output wave will be resampled to that frequency. If no frequency or a higher frequency was specified than the source's, the source wave's frequency will be used.

Download links:
Amiga 68000
Amiga 68020
Amiga 68020 + 68881
Linux AMD64
Linux i386
Linux PowerPC
MorphOS PowerPC
TCH is offline  
Old 16 May 2014, 00:58   #2
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,858
Big thx!, Any chance for Win32 binary version?
pandy71 is offline  
Old 16 May 2014, 13:54   #3
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,307
Just had a fast test but it works so far. You may could add "wav28svx ?" support to get info/template.
daxb is offline  
Old 26 June 2014, 15:51   #4
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
Whoops, did not notice that there were replies...

@pandy71: Sorry, i don't have any kind of windows.

@daxb: If you don't pass parameters, then it shows the help.
TCH is offline  
Old 29 June 2014, 18:00   #5
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,858
Quote:
Originally Posted by jsr View Post
@pandy71: Sorry, i don't have any kind of windows.
Don't worry - i have and MS claims it is POSIX complaint thus perhaps it can be not a big problem to create Win32 binary (depend on tools You use).
But this is only "nice to have" so don't bother if this is bigger issue.
pandy71 is offline  
Old 06 July 2014, 10:16   #6
Skope
Protracker
 
Skope's Avatar
 
Join Date: Sep 2008
Location: 8364
Posts: 381
I don't mean to be a party pooper, but I usually just...

Code:
for f in *.wav ; do sox "$f" -D -r16574 -b8 "$f".svx8 ; done
...when I wanna convert WAV to IFF samples on my Mac. Personally i convert to RAW (replace .svx8 to .raw) and use an ungodly amount of decimals for the sample rate (I want it to hit C-3 equivalent in ProTracker on a PAL Amiga). My samples are usually already in mono but it's just a matter of adding
Code:
remix 1-2
if you wanna mix down a stereo file to a mono file. Or
Code:
remix 1-4
for a 4-channel WAV etc.
Skope is offline  
Old 06 July 2014, 13:35   #7
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,307
Quote:
Personally i convert to RAW (replace .svx8 to .raw) and use an ungodly amount of decimals for the sample rate (I want it to hit C-3 equivalent in ProTracker on a PAL Amiga).
I always disliked this. In most sampling software you can only choose record frequency not accurate enough to fit exactly to the note used in trackers like Protracker. In most cases you don`t hear disharmonies if you e.g. load a 22050 Hz mono sample and play it on note F-3. Anyhow, ...
daxb is offline  
Old 07 July 2014, 21:40   #8
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,858
SoX can be used always (as it provide Very High Quality for resampling) - fractional resampling can be not easy (as samplerate must be integer) but with tweaking source sample rate and final sample rate it can be extremely accurate.
pandy71 is offline  
Old 12 July 2014, 04:00   #9
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
@Skope:
Code:
root@Csabi:~# time sox fancy.wav -D -r16754 -b8 fancy_sox.8svx remix 1

real    0m0.137s
user    0m0.124s
sys     0m0.008s
root@Csabi:~# time wav28svx fancy.wav fancy_wav28svx.8svx 16754
847053 samples will be converted.
46937/847053
93877/847053
140816/847053
187756/847053
234696/847053
281636/847053
328576/847053
375516/847053
422456/847053
469396/847053
516336/847053
563276/847053
610216/847053
657156/847053
704096/847053
751036/847053
797976/847053
844916/847053
847053/847053
Conversion completed.

real    0m0.030s
user    0m0.028s
sys     0m0.004s
root@Csabi:~#
wav28svx was roughly 4.5 times faster than sox. I did tested only on my Linux machine, but i think on Amiga, the difference would be even more bigger.

http://oscomp.hu/depot/fancy.wav
http://oscomp.hu/depot/fancy_sox.8svx
http://oscomp.hu/depot/fancy_wav28svx.8svx

wav28svx is clearer, sox is more muffled.

System requirements for sox on Amiga are:
- 68020 or greater CPU
- 6888x
- At least 4096 kB free disk space
- At least 4096 kB free RAM
- HDD (you cannot run a 3.5 MB exe from floppy)
- Fast RAM (you cannot load a 3.5 MB exe into 2 MB or less Chip RAM)
- KickStart 2.0 or greater
- ixemul.library

System requirements for wav28svx on Amiga are:
- Any 680x0 CPU
- 6888x or mathieeedoubbas.library
- At least 18 kb free disk space
- At least 32 kb free RAM
- Any KickStart

In short: sox will run on only heavily expanded machines, while wav28svx runs on any Amigas, stock or expanded.
TCH is offline  
Old 13 July 2014, 16:24   #10
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,858
Quote:
Originally Posted by jsr View Post
wav28svx is clearer, sox is more muffled.
Sox prevent aliasing this is why it is "muffled" -
try this one with sox
Code:
@sox --multi-threaded --buffer 131072 -S -V -D "%1" "%1.8svx" remix - rate -v -s -I -b 99 -a 16754 gain -n -0.14 dither -S stats -b 8
(it works under Windows but i hope same parameters can be used under linux)

btw "muffled" sound can be overcome by using gentle preemphasis filter (highpass)
Code:
@sox --multi-threaded --buffer 131072 -G -S -V -D "%1" "%1.8svx" remix - treble 6.0206 4000 rate -v -s -I -b 99 -a 16754 gain -n -0.103

Last edited by pandy71; 13 July 2014 at 16:48.
pandy71 is offline  
Old 13 July 2014, 17:15   #11
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
how is the conversion done? is there any resampling or dithering?
Mrs Beanbag is offline  
Old 13 July 2014, 21:37   #12
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
@thread:
Waw28SVX v2.0.1 released, new code is roughly 37% faster than 2.0.0. Links are the same as in the opening post.

@pandy71:
I tried it, the sound is less muffled with this way.
However with this method the conversion was 1.7 times slower than the former sox converting method, 7.5 times slower than wav28svx 2.0.0 and 10 times slower than wav28svx 2.0.1.

@Mrs Beanbag:
Dithering no, resampling yes, but only if you specify the destination frequency, else it will only mix the channels (if there are more than one channels).
TCH is offline  
Old 14 July 2014, 01:25   #13
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,858
Quote:
Originally Posted by jsr View Post
@pandy71:
I tried it, the sound is less muffled with this way.
However with this method the conversion was 1.7 times slower than the former sox converting method, 7.5 times slower than wav28svx 2.0.0 and 10 times slower than wav28svx 2.0.1.
Cost of HQ resampling is obviously more visible on slower machine - this is why always prefer to use PC to create source files.
pandy71 is offline  
Old 14 July 2014, 16:32   #14
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,307
"Hidden" body text.

Would be nice to have one archive for the 68k versions for the few bytes and a Readme included. Or make a prober aminet release.
daxb is offline  
Old 16 July 2014, 23:10   #15
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
@pandy71:
Yeah, but sox did not produced ten times better sound, so i feel this much resource need a bit too much.

@daxb:
The archives are separate, because this tool should be in C: and the executable names are identical. I could put them in drawers by CPU, but why? The three archives together weighs around 32k, i think that's small enough.

As for the readme, what should i write into it? The program prints the usage when no parameters passed, no further info needed to use.

If you think, there is a need for an aminet release, then you can make an aminet archive the way you want: you can put the three version into the same archive and you can include a readme too; the tool is free to put to any website.

Last edited by TCH; 20 July 2014 at 09:37.
TCH is offline  
Old 09 March 2015, 19:56   #16
mjnurney
Registered User
 
Join Date: Aug 2009
Location: Towcester, Northampton
Posts: 311
What does invalid header on .wav mean?

invalid wav file. error in header.

i have converted some short mp3 files to wav but i get this error? - my error I'm sure?

cheers
mike

****sorted.

it was a bad conversion from mp3 to wav causing the problem.

Last edited by mjnurney; 10 March 2015 at 11:53.
mjnurney is offline  
Old 23 April 2015, 01:57   #17
TCH
Newbie Amiga programmer
 
TCH's Avatar
 
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
3.0.0 released, with three new platforms: FreeBSD, Haiku, Solaris and several changes:
- Static, wired in IFF header replaced with dynamic IFF generator.
- Static, wired in Wav header parsing replaced with a generic Wav parsing unit.
- Static, wired in arguments replaced with the same argument processor, like in PNG2ILBM.
- Bogus VHDR volume fixed, Reggae on MorphOS now can play the resulting files.
- Missing octave fixed, ProTracker now can import the resulting files.
- Optimizations, some percentage faster on non 2^n channel number and a lot faster if the channel number can be divided by 2.

The program got heavier by cca. 8 kByte, but it's faster, have less bugs and have a much more cleaner design inside, so i think it's not that drastic.

Oh, and it got a site like PNG2ILBM, it's here: http://bgafc.t-hosting.hu/wav28svx.html

Last edited by TCH; 23 April 2015 at 02:22. Reason: the forum not supports the 'sup' tag, PT added to list, past tense removed, explained reggae crash
TCH is offline  
Old 05 June 2017, 00:13   #18
fstltna
Indie Game Dev
 
fstltna's Avatar
 
Join Date: May 2017
Location: South San Francisco, US
Age: 56
Posts: 227
Send a message via AIM to fstltna Send a message via Yahoo to fstltna
Ok, I'm using the latest version of wav28svx to convert some short samples from 44khz .WAV files. I see the default files have a 6026hz sample rate but when I try this I get a error:

Code:
wav28svx input.wav output.8svx -mr 6026
Note: Files already specified, argument 4 ignored
If I put it as:
Code:
wav28svx input.wav output.8svx -mr6026
I get no message at all. Either way the 8svx file is created at 48khz, the source rate.

What am I doing wrong?
====
Update: I switched to using SOX to convert the files and it works fine....

Last edited by fstltna; 05 June 2017 at 01:06. Reason: Resolved
fstltna is offline  
Old 05 June 2017, 15:38   #19
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,307
@fstltna:
Which version did you used?


I`m using v3.0.0 Amiga 68020+68881 on A1200 040 3.1. Seems it is broken. I converted some wav`s and the result can`t be played with Play16 or Multiview. Play16 says "Error #5: File is corrupt!" and Multiview don`t recognize it and shows it as hex output. Header of such an result:
Code:
0000: 464F524D 00000078 38535658 56484452 00000014 00000000 FORM...x8SVXVHDR........
0018: 00000000 00000000 AC440100 00010000 494E464F 00000030 ........¬D......INFO...0
0030: 436F6E76 65727465 64206279 20576176 32385356 58207633 Converted by Wav28SVX v3
0048: 2E302E30 20416D69 67612036 38303230 2B363838 38310A00 .0.0 Amiga 68020+68881..
0060: 46414354 00000010 6D696372 6F736F66 74205355 434B5321 FACT....microsoft SUCKS!
0078: 424F4459 00000000 00FFFFFF FFFFFFFF FFFF0000 00010102 BODY.....ÿÿÿÿÿÿÿÿÿ......
0090: 03030404 05050505 05050505 05050506 06070708 09090A0B ........................
00A8: 0C0D0E10 11121314 15151516 16161617 18191A1C 1D1D1D1D ........................
00C0: 1C1A1816 14121110 0F0F1011 12131416 17181A1A 1B1C1C1C ........................
00D8: 1D1D1D1D 1D1D1C1C 1C1C1C1B 1B1B1B1B 1A1A1A1A 19191818 ........................
00F0: 17171716 16161616 16161616 17171717 17171716 15151413 ........................
Option "-sr22050" works but the result is like obove description.

If I use "-sr" option without a number or a space and a number following error message is shown:
Code:
Error 0x00000008: Too high sample rate for 8svx.
Further, some MuForce hits appear (null pointer?):
Code:
05-Jun-17   12:38:57
LONG READ from 00000000                        PC: 0177E56C
USP : 01ED6D48 SR: 0004  (U0)(-)(-)  TCB: 01E98E28
Data: 00000000 00000000 0000FFFF 01BEB544 00000003 0000000D 0000000F 0000000C
Addr: 01741950 017418B4 0174198C 01741978 01639FF0 01ED6F28 00000000 010826EC
Stck: 01ED6F0C 00000000 0000FFFF 01BEB544 00000023 00585C09 006F92AD 0177D204
Stck: 01BEB544 0132BF19 01080CB0 7FFF0000 FFFFFFFF FFFFFFFF 7FFF0000 FFFFFFFF
Stck: FFFFFFFF 7FFF0000 FFFFFFFF FFFFFFFF AC440000 00000000 7FFF0000 FFFFFFFF
Stck: FFFFFFFF 7FFF0000 FFFFFFFF FFFFFFFF 7FFF0000 FFFFFFFF FFFFFFFF 7FFF0000
Stck: FFFFFFFF FFFFFFFF 7FFF4966 20796F75 2072656D 6F766520 74686520 616E7469
Stck: 2D6D2420 6D657373 61676573 2066726F 6D207468 69732070 726F6761 6D2C2074
----> 0177E56C - "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset 00001364
----> 0177D204 - "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset FFFFFFFC
PC-8: 66044A00 66F66600 00D0226F 01AC2C71 78002C76 0162000A 000442A7 486F01C0
PC *: 2F166100 FBF64FEF 000C4A80 670A7008 2F4001CC 600000AE 0CAF0000 FFFF01BC
0177e54c :  6604                       bne.s $177e552
0177e54e :  4a00                       tst.b d0
0177e550 :  66f6                       bne.s $177e548
0177e552 :  6600 00d0                  bne $177e624
0177e556 :  226f 01ac                  movea.l $1ac(a7),a1
0177e55a :  2c71 7800                  movea.l $0(a1,d7.l),a6
0177e55e :  2c76 0162 000a 0004        movea.l ([$a.w,a6],$4.w),a6 ;extended opcode
0177e566 :  42a7                       clr.l -(a7)
0177e568 :  486f 01c0                  pea.l $1c0(a7)
0177e56c : *2f16                       move.l (a6),-(a7)
0177e56e :  6100 fbf6                  bsr $177e166
0177e572 :  4fef 000c                  lea.l $c(a7),a7
0177e576 :  4a80                       tst.l d0
0177e578 :  670a                       beq.s $177e584
0177e57a :  7008                       moveq.l #$8,d0
0177e57c :  2f40 01cc                  move.l d0,$1cc(a7)
0177e580 :  6000 00ae                  bra $177e630
0177e584 :  0caf 0000 ffff 01bc        cmpi.l #$ffff,$1bc(a7)
Name: "Shell Process"  CLI: "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset 00001364


05-Jun-17   12:38:57
BYTE READ from 00000000                        PC: 0177E182
USP : 01ED6D2C SR: 0004  (U0)(-)(-)  TCB: 01E98E28
Data: 00000000 00000000 0000FFFF 01BEB544 00000003 0000000D 00000000 0000000C
Addr: 00000000 01ED6F0C 00000000 01741978 01639FF0 01ED6D3C 00000000 010826EC
Stck: 0000000D 0000000F 0000000C 0174198C 01ED6F28 0177E572 00000000 01ED6F0C
Stck: 00000000 0000FFFF 01BEB544 00000023 00585C09 006F92AD 0177D204 01BEB544
Stck: 0132BF19 01080CB0 7FFF0000 FFFFFFFF FFFFFFFF 7FFF0000 FFFFFFFF FFFFFFFF
Stck: 7FFF0000 FFFFFFFF FFFFFFFF AC440000 00000000 7FFF0000 FFFFFFFF FFFFFFFF
Stck: 7FFF0000 FFFFFFFF FFFFFFFF 7FFF0000 FFFFFFFF FFFFFFFF 7FFF0000 FFFFFFFF
Stck: FFFFFFFF 7FFF4966 20796F75 2072656D 6F766520 74686520 616E7469 2D6D2420
----> 0177E182 - "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset 00000F7A
----> 0177E572 - "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset 0000136A
----> 0177D204 - "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset FFFFFFFC
PC-8: 2A5F4E75 2F0D9BCD 4EB90178 0F1048E7 0720246D 0008204A 226D000C 2C2D0010
PC *: 4A1866FC 538891CA 22082001 4A866702 20062C00 200A670A 4A866706 700AB280
0177e162 :  2a5f                       movea.l (a7)+,a5
0177e164 :  4e75                       rts
0177e166 :  2f0d                       move.l a5,-(a7)
0177e168 :  9bcd                       suba.l a5,a5
0177e16a :  4eb9 0178 0f10             jsr $1780f10
0177e170 :  48e7 0720                  movem.l d5-d7/a2,-(a7)
0177e174 :  246d 0008                  movea.l $8(a5),a2
0177e178 :  204a                       movea.l a2,a0
0177e17a :  226d 000c                  movea.l $c(a5),a1
0177e17e :  2c2d 0010                  move.l $10(a5),d6
0177e182 : *4a18                       tst.b (a0)+
0177e184 :  66fc                       bne.s $177e182
0177e186 :  5388                       subq.l #$1,a0
0177e188 :  91ca                       suba.l a2,a0
0177e18a :  2208                       move.l a0,d1
0177e18c :  2001                       move.l d1,d0
0177e18e :  4a86                       tst.l d6
0177e190 :  6702                       beq.s $177e194
0177e192 :  2006                       move.l d6,d0
0177e194 :  2c00                       move.l d0,d6
0177e196 :  200a                       move.l a2,d0
0177e198 :  670a                       beq.s $177e1a4
0177e19a :  4a86                       tst.l d6
0177e19c :  6706                       beq.s $177e1a4
0177e19e :  700a                       moveq.l #$a,d0
0177e1a0 :  b280                       cmp.l d0,d1
Name: "Shell Process"  CLI: "Tools:Sfx/Misc/wav28svx/wav28svx"  Hunk 0000 Offset 00000F7A
daxb is offline  
Old 06 June 2017, 00:46   #20
fstltna
Indie Game Dev
 
fstltna's Avatar
 
Join Date: May 2017
Location: South San Francisco, US
Age: 56
Posts: 227
Send a message via AIM to fstltna Send a message via Yahoo to fstltna
I was using version 3.0 too. But after using sox i like sox better

Last edited by fstltna; 06 June 2017 at 09:30.
fstltna 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
Porting to Tiny Core Linux and Puppy Linux lorenzos support.FS-UAE 1 05 January 2013 16:13
AmIRC for Classic Amiga and MorphOS XDelusion request.Apps 7 10 September 2011 19:12
.wav to Amiga .iff sound file KevG request.Apps 8 14 May 2010 23:15
Converting WAV to Amiga IFF on the Mac ami_junkie support.Apps 0 27 February 2010 02:25
Amiga IDE HD on MorphOS Crown support.Hardware 4 04 May 2009 07:49

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 19:24.

Top

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