Doing things to specific sounds.

New releases and general discussions.

Post » Thu Jul 30, 2009 5:38 pm

I think it would be really useful if you could, with the sound plugin, just tell it to change frequency, volume or pan to "sound.wav" instead of seemingly having to do it to channels. Right now it seems a hassle to just change the volume of one sample that may play at the same time on the same channel as another sample.

That's pretty much it. I would find it extremely useful, and I hate to bring up MMF again but that's how it works in it...

EDIT: While I'm at it... it would be nice if the "play sound at object" didn't necessarily include volume, or have it seperate. I like it for its panning function, but sounds get quitier much too fast when you get away from the center of the listener position.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Thu Jul 30, 2009 5:44 pm

What if two "sound.wav"s are playing? Should it affect both, or one? If both, what if you wanted to control just one? If one, which one?

I think the current system is very simple, just use the get last channel autoplayed expression after an Autoplay action, and set the parameters for that channel.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Thu Jul 30, 2009 5:57 pm

But wouldn't that do the same thing where it could affect two sounds. And mind you, the current use for it I would have would be for a character who has all the sounds played AT the character, with a channel associated with the character. That would affect multiple samples playing at once, no?

It's overall a simpler approach too. About affecting two of the same samples, it did in MMF but the way I usually did things was to say to "stop" that specific sample before ever playing it again (can you stop specific samples now?).

If I don't associate the character with a channel, does Construct make a new channel for every consecutive sample being played, for any object?

Also, needing a new event to make the settings of a sample seems annoying. Maybe you play two samples in the same event, how does getting the last channel used work then?

Questions, questions, questions?

EDIT: About affecting one sample, if the setting are given right after the sample is played in the same event, does that not make it possible?
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Thu Jul 30, 2009 7:01 pm

Playing around with adding sounds some more it seems really problematic. Attaching no samples to specific channels seems to place them all in the same one. I have a footstep sample and I made one foot in the run animation play the sound slightly faster, but this affects EVERY sample that plays if it plays at the same time or close to the foot sample.

I imagined playing a sample outside of a specific channel would make it its own thing, hence why I requested the sample specific action like volume, frequency and stopping.

Right now it seems really obnoxious and hard to get around. :oops:
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Fri Jul 31, 2009 3:52 am

every single audio library existing today works with channels.
Only a single sample can be playing on one channel at any given time.

That said, I could never get XAudio working with anything but autoplay :oops: for some reason
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Jul 31, 2009 3:53 pm

You're really overcomplicating this! It's very simple: use Autoplay for everything, and an action to set the parameters of the last autoplayed channel to control them.

[quote="konjak":2dmvivwn]And mind you, the current use for it I would have would be for a character who has all the sounds played AT the character, with a channel associated with the character. That would affect multiple samples playing at once, no?[/quote:2dmvivwn]
No: you can only play one sound on one channel at a time. To achieve mixing (playing multiple sounds at once), you must play two simultaneous sounds on different channels. This is what autoplay is for - it picks a free channel and uses that to play the sound, and that channel number is what the 'get last channel autoplayed on' expression returns, so you can control every sound individually.

[quote:2dmvivwn](can you stop specific samples now?).[/quote:2dmvivwn]
Yes, you have always been able to in XAudio2, just pass the channel number to stop.

[quote:2dmvivwn]If I don't associate the character with a channel, does Construct make a new channel for every consecutive sample being played, for any object?[/quote:2dmvivwn]
As I said, autoplaying will assign a sound to a free channel automatically.

[quote:2dmvivwn]Also, needing a new event to make the settings of a sample seems annoying. Maybe you play two samples in the same event, how does getting the last channel used work then?[/quote:2dmvivwn]
I don't see a problem here. You'd just do something like
-> Autoplay "sound1.wav"
-> Set channel <last channel autoplayed> volume to 90
-> Autoplay "sound2.wav"
-> Set channel <last channel autoplayed> volume to 80

Voila, two independent volume sounds, all in one event.
I think you're trying to control the specific channel on which every sound plays. That is unecessary. You should be taking advantage of autoplay.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Fri Jul 31, 2009 11:09 pm

Well, okay, thanks...

But it still somehow affected the frequency of another sample playing at the same time...

Also, stopping specific samples that may or may not be playing, what's the solution to that when the last channel set is probably not that specific one and I've used autoplay?

Thanks for all the help!

EDIT: I guess playing those on given channels, then.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Aug 01, 2009 9:04 pm

Uhm, how do I actually place a resource sample on a given channel? I can't find any such action anywhere, only autplay resource, which puts it on a random, free channel.

Maybe you can set a variable to the last channel used but that isn't really necessary, is it?

EDIT: Sorry, found it. Let's see how many posts I make in this thread!
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sun Aug 02, 2009 9:16 am

Is "Set channel XAudio2.LastChannel volume to (something)" supposed to work with positioned sounds? I couldn't get it to affect sounds played by autoplay file at position, or autoplay file at object. However, it does work perfectly with the non-positioned "autoplay file".
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Mon Aug 03, 2009 4:03 pm

Playing at a position affects the volume so it's possible it locks it. Again, I'd love a feature where the volume is not affected by positioned sound, it only creates panning automatically. Like, a "restore volume" action that overrides positioned sounds.
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests