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 Classic Chat / Save more than one sound as a file

Author
Message
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 15th Aug 2017 19:36
Hello all together,
i would be happy, if someone helps. Is there a way in AppGameKit to save more than one sound as a file? For example, if i use a timer and the second sound starts a few seconds later than the first, than the third and so on.
I guess that with savesound only one sound can be saved, right? Maybe is there another way?
Thank You.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 15th Aug 2017 20:47 Edited at: 15th Aug 2017 20:53
you can mix sounds with Memblock commands
CreateMemblockFromSound .. CreateSoundFromMemblock command

but i think it is more comfortable using a music editor, there you can arrange the sounds and record / export as new.
AGK (Steam) V2017.07.19 : Windows 10 Pro 64 Bit : AMD (17.4.4) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 16th Aug 2017 18:44
Thank you Markus,
for some of the work i want to use an editor, but to play the sounds at different times and then to make a soundfile from it, i have to make it with the AGK. I don´t know much about memblocks, but if it work with this i would learn it.
Do you think it´s possible?

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Aug 2017 07:21 Edited at: 17th Aug 2017 07:25
yes, sure its possible in agk.

look here in Description, you have a header block (agk intern) with the audio format and after that comes raw data with your wave form.
https://www.appgamekit.com/documentation/Reference/Memblock/CreateMemblockFromSound.htm

if your audio format is 44100 Hz 16 Bit Stereo your data are 176400 Bytes per second. (44100 * 4 bytes)

visual basic 6 example - i wrote myself long ago to create a wave form and save it as wave file
AGK (Steam) V2017.07.19 : Windows 10 Pro 64 Bit : AMD (17.4.4) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 17th Aug 2017 19:38
Thank you, i am happy that it´s possible, but your code of visual basic looks very complicated. I will work with the create memblock from sound this weekend, but it looks complicated, too.
Maybe you will help me a little bit.
sprcoll
11
Years of Service
User Offline
Joined: 26th Aug 2012
Location:
Posted: 23rd Aug 2017 19:56
Hello,
i have searched for some good tutorials, but a really good ones i haven´t found. I have searched by c++ codes and java codes about to create a wav file, but all the codes are different. In all codes the same is the header block with "format, channels, samplerate and so on".
But what is also needed? Does somebody wan´t to write a small tutorial, not the complete code, but a little advise what i have to learn?


Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 24th Aug 2017 09:53
Quote: "
CreateMemblockFromSound
The next 4 bytes are the number of frames in the sound data, the size of the sound data in bytes can be calculated from this with the formula numFrames*(bitsPerSample/8)*channels."


if you know the format the only interesting value is the data lenght in bytes, this is set in header.
if you have one wave it looks
header+data
two waves
header+data
header+data
mixed together
header+data+data

you can also use CreateMemblock and then use the CreateSoundFromMemblock / SaveSound

AGK (Steam) V2017.08.16 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)

Login to post a reply

Server time is: 2024-04-19 03:58:07
Your offset time is: 2024-04-19 03:58:07