gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > wav to s3m conversion for krawall use

#110032 - katapulp - Fri Nov 24, 2006 2:43 pm

Hi there,

I keep trying to play s3m sample using krawall library on Visual Ham with no success (or strange one).... I had a look at most of the posts here related to sound conversion, but I really can't figure out what's the problem with my project.

I used Audition to convert my wav to a PCM 8bits mono, 8363hz sound file. Then I used Modplug Tracker to import the wav as a sample, and exported it as a s3m file.

Everytime I modify the makefile and compile the project, and I got this error message:

Code:
c:/gbadev/tools/win32/krawall/converter tones.s3m
========================================================
KRAWALL Soundsystem
Copyright (c) 2001, 2002 Sebastian Kienzl <seb@riot.org>
========================================================
s3m-converter v1.0b for NON-COMMERCIAL USE

converting tones.s3m...
name: "untitled"
checking channels: !!!!!!!!!!!!!!!!................
while doing stuff: empty file!!! (sfx?)

checking samples:
removing 0-samples: ..............................
cutting beyond loop-point:
extending loops:
removing duplicate samples:
saving samples: .
c:/gbadev/gcc-arm/bin/arm-thumb-elf-as.exe -mthumb-interwork  tones.s -o tones.o
Assembler messages:
Error: can't open tones.s for reading
tones.s: No error
make: *** [tones.o] Error 1


I also tried to convert the s3m as a mod file, then closed it, opened it, changed to s3m again... and it didn't work. I, of course, tried with other files, with no success.

It seems to be a frequency problem, but I really don't know what's wrong with this test file. I think I've followed all the good steps to convert to s3m...

I would really appreciate can give me a hand on this! I might have miss something. If someone can send me a s3m sample file, I'll try with it.

Here are my source files.

sound files
http://www.regarde.org/temp/tones.wav
http://www.regarde.org/temp/tones.s3m


main.h

Code:
#include "mygba.h"
#include "samples.h"


u32 g_Frames=0;
u32 g_NewFrame=0;


void vblFunc(void);

int main(void)
{
       ham_Init();
kragInit(KRAG_INIT_STEREO);
   ham_StartIntHandler(INT_TYPE_TIM1,&kradInterrupt);
   ham_StartIntHandler(INT_TYPE_VBL,&vblFunc);

while(1)
  {
     
  if(g_NewFrame) {
   kramPlay(samples[ 0 ], TRUE, 0);
   g_NewFrame=0;
  }
 
}

}

void vblFunc(void)
{
    kramWorker();

   g_NewFrame=1;
}


makefile

Quote:
#################################
# HAM Makefile
#################################


include $(HAMDIR)/system/master.mak

#
# Set the name of your desired GBA image name here
#

PROGNAME=demo
OFILES += main.o

#
# Compile using Krawall software (set to yes or no) ?
# Also specify if Krawall is registered (yes or no)
#

USE_KRAWALL=yes
KRAWALL_IS_REGISTERED=no
KRAWALL_FILES= tones.s3m


######################################
# Standard Makefile targets start here
######################################

all : $(PROGNAME).$(EXT) clean

#
# Most Makefile targets are predefined for you, suchas
# vba, clean ... in the following file
#
include $(HAMDIR)/system/standard-targets.mak

######################################
# custom Makefile targets start here
######################################

#110036 - tepples - Fri Nov 24, 2006 3:02 pm

katapulp wrote:
I keep trying to play s3m sample using krawall library on Visual Ham with no success (or strange one).... I had a look at most of the posts here related to sound conversion, but I really can't figure out what's the problem with my project.

I used Audition to convert my wav to a PCM 8bits mono, 8363hz sound file.

How big is the wav file?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#110037 - katapulp - Fri Nov 24, 2006 3:30 pm

hmm you're right, that was a size problem.
It works with a smaller file...


Is it normal to have a very metallic sound wich echo (very different from the modplug sound preview) ?

#110047 - tepples - Fri Nov 24, 2006 8:14 pm

If you're making a music track, you should use one .wav per instrument and sequence it in Modplug Tracker, not just record the whole thing to a .wav and try to import it.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.