English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 03 March 2024, 14:24   #1
Etze
A3000-Fan
 
Etze's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 321
IncBin Soundsamples

I'm trying to include some very small soundsamples into the exe of a game but I guess I'm doing something wrong.


I stripped it down to this code which does nothing but a short wait and ends after that:
Code:
WBStartup

DecodeSound 1,?snd1
DecodeSound 2,?snd2
DecodeSound 3,?snd3
DecodeSound 4,?snd4
DecodeSound 5,?snd5
DecodeSound 6,?snd6
DecodeSound 7,?snd7
DecodeSound 8,?snd8

Delay_ 50




End

.snd1
IncBin "snd/grau.iff"
.snd2
IncBin "snd/gruen.iff"
.snd3
IncBin "snd/gelb.iff"
.snd4
IncBin "snd/klick.iff"
.snd5
IncBin "snd/gewonnen.iff"
.snd6
IncBin "snd/verloren.iff"
.snd7
IncBin "snd/unbekannt.iff"
.snd8
 IncBin "snd/start.iff"

On Kick 3.2 I get a Software Failure 80000003 Requester when it ends. But ONLY when I don't include Debug-Info. Within my game I can use the sounds without a problem but again, when it ends, I get the Software Failure.
On Kick 1.3 it won't even start and throws an error requester which I can't read (white on white). Even with Debug-Info.


Anything obvious that I'm doing wrong?
Etze is offline  
Old 03 March 2024, 14:29   #2
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Use only samples with even length.
Don_Adan is offline  
Old 03 March 2024, 15:03   #3
Honitos
Registered User
 
Honitos's Avatar
 
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
Are you using BlitzBasic?
I fixed the wrong text colours of the error requester with AmiBlitz3.

I may be a path problem. You could check this with SnoopDOS.
Honitos is offline  
Old 03 March 2024, 15:20   #4
Etze
A3000-Fan
 
Etze's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 321
Quote:
Originally Posted by Honitos View Post
Are you using BlitzBasic?
I fixed the wrong text colours of the error requester with AmiBlitz3.
You're right. I normally use BB2.1. But I just tried it in AmiBlitz. The requester is readable again (Software Error - Task held...) and then Guru.


Quote:
I may be a path problem. You could check this with SnoopDOS.
Shouldn't be, because the exe doesn't load anything at runtime. But just to be sure I tried it before (even with SnoopDos 1.7 under Kick 1.3): nothing.
Etze is offline  
Old 03 March 2024, 15:24   #5
Etze
A3000-Fan
 
Etze's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 321
Quote:
Originally Posted by Don_Adan View Post
Use only samples with even length.

Aha! Is it the filelength or only the raw data? I don't know anything about iff-Sound.



And how do I make sure the samples have the correct length - how do I "correct" them?
Etze is offline  
Old 03 March 2024, 17:05   #6
Honitos
Registered User
 
Honitos's Avatar
 
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
What a dumb hint from me with SnoopDOS.
Obviously there is nothing to load with the samples linked to the binary :-)

But there should be no crash with activated debugger. Is it turned on?
Honitos is offline  
Old 03 March 2024, 17:35   #7
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by Etze View Post
Aha! Is it the filelength or only the raw data? I don't know anything about iff-Sound.



And how do I make sure the samples have the correct length - how do I "correct" them?
The best both. You can use any IFF sample editor. Add null (empty) byte at end, or remove last byte from odd even length sample(s).
Don_Adan is offline  
Old 03 March 2024, 17:37   #8
Etze
A3000-Fan
 
Etze's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 321
Quote:
Originally Posted by Honitos View Post
But there should be no crash with activated debugger. Is it turned on?

Correct, no crash with debugger.
Etze is offline  
Old 03 March 2024, 22:08   #9
Etze
A3000-Fan
 
Etze's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 321
Quote:
Originally Posted by Don_Adan View Post
The best both. You can use any IFF sample editor. Add null (empty) byte at end, or remove last byte from odd even length sample(s).
Thank you very much, I got it working! I just cut a little bit of the samples in the hope that it will be even length. That worked out and now I don't get a Guru anymore .
Etze is offline  
Old 04 March 2024, 08:33   #10
carrion
Registered User
 
carrion's Avatar
 
Join Date: Dec 2016
Location: Warsaw area
Posts: 152
please try to put the keyword "Even"
after each IncBin to make start next sounds from even addresses.
like this:

.snd1
IncBin "snd/grau.iff"
Even
carrion is offline  
Old 05 March 2024, 11:29   #11
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,344
Yep, sounds like an alignment problem alright - that error probably wouldn't happen on a 68020 or above in that case. The Even keyword can be used as suggested to control the alignment of data in memory. You can also put it before the first Incbin, just in case the previous code or data ends at an odd address.

For reference, the sound data itself from an IFF-8SVX file should always be even in length, and all IFF hunks (headers etc.) should also be even in length, but it's possible that whatever software created the sample didn't entirely follow the standard.
Daedalus is offline  
Old 05 March 2024, 12:00   #12
Etze
A3000-Fan
 
Etze's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 321
Thanks. I had used Audacity to create the 8svx files. Loading and just saving it with Samplitude didn’t help, so I cut a tiny bit and saved it again. That worked. Next time I will test it with the Even keyword.
Etze is offline  
Old 24 March 2024, 20:45   #13
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,214
You might want to force them into chip ram too - you can do this in Amiblitz3 with the chip keyword before the first sound entry. An alternative is test the address and copy into a chip buffer if the returned address is above the chip range.
E-Penguin 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
incbin in C23 alkis Coders. C/C++ 3 10 August 2022 16:27
Playing a module from INCBIN in AmiBlitz 3.8 zooperdan Coders. Blitz Basic 18 10 December 2021 08:39
AsmOne and IncBin Nightshft Coders. Asm / Hardware 2 26 November 2019 16:36
INCBIN weirdness neumanix Coders. Blitz Basic 16 15 September 2018 20:40
blitz incbin.. yoki Coders. General 5 03 April 2009 12:29

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 21:00.

Top

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