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.

AppGameKit Studio Chat / Generating Sounds

Author
Message
Mr_Tickleishxxx
6
Years of Service
User Offline
Joined: 26th Mar 2018
Location:
Posted: 25th Nov 2024 20:44
Hi

Not sure this is possible, but is there a way to generate sounds without having to load samples? I'm guessing using midi or something.. I basically want to make a sound frequency generator

Cheers
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Nov 2024 21:02
hi, mr_t,

your inquiry reminded me of some work adambiser had done toward a sound buffering notion that i think will interest you. he provided some solid functionality including sound generation/memblock work and insightful comments to go with it.

i hope that helps
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 26th Nov 2024 00:25
You can generate sounds on the fly but it requires a bit of work. If you look up the help for the command "CreateMemblockFromSound" it explains what each byte in the 12 byte header is for. By using this you can create a normal memblock, push the relevant values into the first 12 bytes, followed by all of the data for your sound. Single bytes can be written as bytes (SetMemblockByte), 2 byte values can be written as "shorts" (SetMemblockShort) and the 4 byte values can be written using integers (SetMemblockInt). Then use the "CreateSoundFromMemblock" command to turn it into an actual sound object to play like a WAV file. It works well.

Login to post a reply

Server time is: 2024-11-26 01:45:19
Your offset time is: 2024-11-26 01:45:19