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 / Play looping sound but NOT from start of the sound sample...

Author
Message
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 26th Nov 2020 15:21
Anyone know how you can start a sound playing (and looping) but alter the starting time? With sprites, you can manually set the sprite frame and so have multiple sprites looping but all with different frames at a given time. I'm after the same effect for sounds.... Currently, if you load multiple sounds and get them playing they all play from the start (as you would expect the default behaviour to be!) BUT this means you get weird echo-y type sounds as they almost identically sync. I can't delay the start of playing as it's for monsters dynamically firing up as the player gets close to them.



Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 26th Nov 2020 16:44
I'm trying to figure out what it is you are looking to do. Do you want the same sound to start multiple times? Different sounds to start one after another but with a delay? Can you give an example scenario?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
SFSW
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 26th Nov 2020 23:25
I'd recommend what blink0k points out. Put the sound into a memblock and create a second memblock at the size of the section you want to crop, then transfer the wave data, create the sound index from the smaller memblock, then play it.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 27th Nov 2020 12:04
Hmmm, OK. Was hoping for an easy off the shelf command I'd not spied..... Thanks for the info. Reckon it might be worth an additional command at some stage to allow easy randomisation as can be achieved with sprites.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 1st Jan 2021 02:33
I've made some functions for stitching some split samples together so:

sample part one: engine starts
sample part two: engine loop sound
sample part three: engine shutdown sound

All parts are in the original single sample and you just decide the split points in frames.
Is that the sort of thing you had in mind?

I also made a sound queue system which allows you to specify a delay before the sound actually plays.

Login to post a reply

Server time is: 2024-11-24 05:44:31
Your offset time is: 2024-11-24 05:44:31