Sound load error

Using the Pascal version of SwinGame and you've found a bug? Let us know about it and we will look into it when we get a chance.

Please let us know what operating system you are using, the exact error, when it occurs, etc. the more detail you provide the easier it will be for us to replicate the problem.

Sound load error

Postby Running_tape on Sat Mar 26, 2011 8:25 pm

I was following the tutorial for pong. I managed to build the executable with no problems. But as My Game loaded up resources, an error occurred.

An unhandled exception occurred at $0040BDC8 :
Exception : Error loading sound effect: Mix_LoadWAV_RW with NULL src
$0040BDC8
$0041FA7A
$0041FB73
$0042038A
$0040BF6F
$00401782


I'm sure '$0040BDC8' is related to the position of the error in my script, but I can't read it!

Thanks in advance to anyone who can help.
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Sound load error

Postby acain on Mon Mar 28, 2011 3:41 pm

Can you post up your code so far.
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Sound load error

Postby Running_tape on Wed Mar 30, 2011 6:47 am

OK. I'll send in the code I've added when it stopped working.

In GameResources.pas
Code: Select all
   procedure LoadSounds();
   begin   
      NewSound('boink','Boink.wav');
      NewSound('paddlehit','Paddle.wav');
   end;


In Gamelogic.pas
Code: Select all
     begin
        ball.Movement.X := -ball.Movement.X;
        PlaySoundEffect(GameSound('boink'));
     end
     else if ball.X <= 0 then
     begin
       ball.Movement.X:= -ball.Movement.X;
       PlaySoundEffect(GameSound('boink'));
     end;

Note: this is also the same for Movement.Y

Sorry for the delay.
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Sound load error

Postby acain on Wed Mar 30, 2011 9:52 am

Do you know which line the error occurs on?

Put in some WriteLn calls to check where the code gets to. For example:

Code: Select all
   procedure LoadSounds();
   begin   
      WriteLn('Loading boink');   
      NewSound('boink','Boink.wav');
      WriteLn('Loading paddlehit');   
      NewSound('paddlehit','Paddle.wav');
      WriteLn('Load Sounds done');   
   end;
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Sound load error

Postby Running_tape on Thu Mar 31, 2011 6:56 am

I found the problem. It seems my version of Swingame doesn't accept wav files. I tried using an ogg file and it loads.

Sorry for wasting your time. I should have tried it sooner. But I thank you very much for helping me.
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Sound load error

Postby acain on Thu Mar 31, 2011 3:30 pm

Thats weird, WAV files should work.

What OS are you using?
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Sound load error

Postby Running_tape on Thu Mar 31, 2011 8:58 pm

I'm using Windows XP. Is the problem related to my OS?
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Sound load error

Postby acain on Fri Apr 01, 2011 7:43 am

You should be able to load the WAV files... not sure what the problem is. Sorry. At least you can progress using OGG files :)
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Sound load error

Postby Running_tape on Fri Apr 01, 2011 6:05 pm

That's OK.

I guess I have to manage with OGG files. Thanks anyway! :D
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Sound load error

Postby dan3008 on Thu Apr 14, 2011 8:10 pm

Take a look at format factory. Its free and can convert any sound file to an ogg (it can also do video, but you only get the soundtrack obviously lol)

heres the link http://www.formatoz.com/

Hope that helps :D
dan3008
Journeyman
 
Posts: 43
Joined: Sat Nov 27, 2010 1:57 pm


Return to Pascal Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron