Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Memblock sounds - they have problems - HELP!!

Author
Message
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2003 02:32
Hello. I have noticed that when I try and edit sound memblocks, they come out wrong. look at this:


It loads a file, makes a memblock from it, then reads data out of the memblock and writes it back in again in the same place. Why does the sound come out at half the speed and lenght? help me!
xxxpetratxxx
B. R. W
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 12th Mar 2003 02:36
Because you're missing out all the important header information from the sample:

BitsPerSecond(DWORD)
Frequency(DWORD)
Duration(DWORD)
Sound Data(BYTES)

Don't skip the first 12 bytes, they're important!

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2003 02:48
thanks rich but do you think I could have an example? i have no idea how to do this because I cant get it to work. I just need to know how to make a memblock from a sound, then make a sound from the memblock and play it so that both sounds are the same.


P.S sorry for double posting (accident)

xxxpetratxxx
B. R. W
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 12th Mar 2003 02:53
Change your code so it's for x=0 ... not for x=12 as that will skip the first 12 bytes which are vital because they contain the header information I just mentioned.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2003 02:57


That doesnt work :-(

xxxpetratxxx
B. R. W
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2003 02:58


But look, that doesnt work and I havent even touched the memblock

xxxpetratxxx
B. R. W
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2003 03:04
help me someone pleeeaaaase

xxxpetratxxx
B. R. W
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 12th Mar 2003 06:15
Erm petrat try reading the help files for "save sound" ! They quite clearly state it's for saving a sound that has been recorded with "Record Sound" - hardly what's been done here

Try "make file from memblock" instead.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 12th Mar 2003 14:26

that doesnt work either! how do you explain that?

xxxpetratxxx
B. R. W

Login to post a reply

Server time is: 2025-05-16 20:46:22
Your offset time is: 2025-05-16 20:46:22