# AudioComponent SetWaveParameter with PlayQuantized

**URL:** <https://forums.unrealengine.com/t/audiocomponent-setwaveparameter-with-playquantized/1997668>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [August 30, 2024, 1:41am UTC](https://forums.unrealengine.com/t/audiocomponent-setwaveparameter-with-playquantized/1997668 "2024-08-30T01:41:45Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![JerkyTreats](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JerkyTreats](https://forums.unrealengine.com/u/JerkyTreats)\
**Post date:** [August 30, 2024, 1:18pm UTC](https://forums.unrealengine.com/t/audiocomponent-setwaveparameter-with-playquantized/1997668/3 "2024-08-30T13:18:35Z")

</div>

I’ve confirmed the issue occurs even if there is not duplicate Metasounds playing, so I tried looking at my other idea.

I added the following code to consume the event that fires when the Playstate changes:

```auto
AudioComponent->OnAudioPlayStateChanged.AddDynamic(this, &AAudioCuePlayer::OnPlayStateChange);

void AAudioCuePlayer::OnPlayStateChange(EAudioComponentPlayState PlayState)
{
	switch (PlayState)
	{
	case EAudioComponentPlayState::Playing:
		UE_LOG(LogTemp, Display, TEXT("Playing"))
		AudioComponent->SetWaveParameter(SoundPlayerData.WaveAssetName, SoundPlayerData.WaveAsset);
	default: return;
	}
}

```

My theory was this would set the param when the sound should be definitely playing.

Unfortunately with this code, no sounds are playing. I’ve confirmed its hitting the Playing switch case, but it seems SetWaveParameter is either too late or not triggering… or something.

I dunno, I’ll have to come back to this and figure out what’s going on.

---

_[View the full topic](https://forums.unrealengine.com/t/audiocomponent-setwaveparameter-with-playquantized/1997668)._
