No sound from Media track on sequencer any fix?

Hi i am trying to create a TV that works with sequencer for in game cinematics and exporting it too.
Playing the video file with the media track is easy but why the sound isn’t playing? even when selecting the media sound component and player inside of the media track properties.
Exporting with audio with the .wav auido command comes empty.
audio won’t play either in the sequencer. or in game. (but camera animation and video playback does.)
So why the media track have the option to select the media sound component then? i would need to split the sound from the video and add an audio track everytime?

3 Likes

I’m also stuck with this issue. Media tracks in sequencer play without sound, even when there’s a MediaSoundComponent active in the properties with a MediaPlayer assigned.
(I refer to gameplay, not at sequence rendering/movie export)

Setting an external MediaPlayer in the Advanced properties I get the audio but not the video.

Tested in UE5 .1, with and without the Electra player plugin(s)

¿Is this a bug or are we missing something?
(btw, the editor crashes very often when the sequence play reachs the end of the sequence)

Edit.
There’s a workaround: Extract the audio to a wav file and add an Audio track to the sequencer. But this way means I have to manually split and import the audios, then manually sync audio and video in sequencer. (no big deal, but I’d rather solve the issue and use the audio track embedded in the mp4 video)

1 Like

if you only want to play the audio in gameplay you dont need to split the audio into another track. i did a tutorial for this but it is in spanish UE5: TV para Archviz 05 (blueprints en cinematicas - sequencer) - YouTube
you just need to create an event inside your blueprint and called through an event trigger in your blueprint track. regarding the sound in 5.1 and 5.2 you need to create the media sound component in the event graph with add media sound component node after opening the source because adding a media component in the blueprint scene root wont work, this is a bug that was not present in 5.0.

Hi!

I already did all the work (17 laboriously created sequences), and most of times I also need the video, not only the audio. But I’ll carefully see your tutorial anyway. If it is worth the pain, in definitive version of my app I may use your method for my audio-only uses.

btw… I’m a spaniard from Galicia, it’s perfect for me in spanish.

Thank you Reny!

You mean use the event trigger and AddComponentByClass? I tried this and i tried SetMediaPlayer, not working, using unreal 5.3.1, maybe sth i did wrong?

Running in to same issue. Disappointed to not still see a fix posted here.
Audio works fine in gameplay (i.e. PIE mode), but setting up everything via Sequencer just doesn’t seem to work, no matter how many times I check my settings and making sure I’m using the right media player, component, etc.

1 Like

Running in to same issue. Here is my solution, which needs to change a little engine source code:

// IMovieScenePlayer.h
class IMovieScenePlayer
	: public UE::MovieScene::IObjectBindingNotifyPlaybackCapability
	, public UE::MovieScene::IStaticBindingOverridesPlaybackCapability
{
public:
	//~begin FIX_MOVIE_SCENE_TRACK_NO_SOUND
	virtual class UMediaSoundComponent* GetCustomSoundComponent() const { return nullptr; }
	//~end of FIX_MOVIE_SCENE_TRACK_NO_SOUND
    // ...
}
//  MovieSceneMediaTemplate.cpp
void FMovieSceneMediaSectionTemplate::Initialize(const FMovieSceneEvaluationOperand& Operand, const FMovieSceneContext& Context, FPersistentEvaluationData& PersistentData, IMovieScenePlayer& Player) const
{
    // ...
    if (MediaPlayer == nullptr)
	{
		return;
	}

	const bool IsEvaluating = !(Context.IsPreRoll() || Context.IsPostRoll() || (Context.GetTime().FrameNumber >= Params.SectionEndFrame));
	SectionData->Initialize(IsEvaluating);

	//~begin FIX_MOVIE_SCENE_TRACK_NO_SOUND
	// https://forums.unrealengine.com/t/no-sound-from-media-track-on-sequencer-any-fix/695069
	if (UMediaSoundComponent* SoundComponent = Player.GetCustomSoundComponent())
	{
		if (IsEvaluating)
		{
#if MOVIESCENEMEDIATEMPLATE_TRACE_EVALUATION
			GLog->Logf(ELogVerbosity::Log, TEXT("Setting custom media player %p on media sound component %p"), MediaPlayer, SoundComponent);
#endif

			SoundComponent->SetMediaPlayer(MediaPlayer);
		}
		else if (SoundComponent->GetMediaPlayer() == MediaPlayer)
		{
#if MOVIESCENEMEDIATEMPLATE_TRACE_EVALUATION
			GLog->Logf(ELogVerbosity::Log, TEXT("Resetting custom media player on media sound component %p"), SoundComponent);
#endif

			SoundComponent->SetMediaPlayer(nullptr);
		}
	}
	else if (Params.MediaSoundComponent != nullptr)
	// if (Params.MediaSoundComponent != nullptr)
	//~end of FIX_MOVIE_SCENE_TRACK_NO_SOUND
	{
		if (IsEvaluating)
		{
			#if MOVIESCENEMEDIATEMPLATE_TRACE_EVALUATION
				GLog->Logf(ELogVerbosity::Log, TEXT("Setting media player %p on media sound component %p"), MediaPlayer, Params.MediaSoundComponent.Get());
			#endif

			Params.MediaSoundComponent->SetMediaPlayer(MediaPlayer);
		}
		else if (Params.MediaSoundComponent->GetMediaPlayer() == MediaPlayer)
		{
			#if MOVIESCENEMEDIATEMPLATE_TRACE_EVALUATION
				GLog->Logf(ELogVerbosity::Log, TEXT("Resetting media player on media sound component %p"), Params.MediaSoundComponent.Get());
			#endif

			Params.MediaSoundComponent->SetMediaPlayer(nullptr);
		}
	}

    // ...
}

void FMovieSceneMediaSectionTemplate::TearDown(FPersistentEvaluationData& PersistentData, IMovieScenePlayer& Player) const
{
    // ...
	UMediaPlayer* MediaPlayer = SectionData->GetMediaPlayer();
	if (MediaPlayer == nullptr)
	{
		return;
	}

	//~begin FIX_MOVIE_SCENE_TRACK_NO_SOUND
	if (UMediaSoundComponent* SoundComponent = Player.GetCustomSoundComponent())
	{
		if (SoundComponent->GetMediaPlayer() == MediaPlayer)
		{
			SoundComponent->SetMediaPlayer(nullptr);
		}
	}
	else if ((Params.MediaSoundComponent != nullptr) && (Params.MediaSoundComponent->GetMediaPlayer() == MediaPlayer))
	// if ((Params.MediaSoundComponent != nullptr) && (Params.MediaSoundComponent->GetMediaPlayer() == MediaPlayer))
	//~end of FIX_MOVIE_SCENE_TRACK_NO_SOUND
	{
		Params.MediaSoundComponent->SetMediaPlayer(nullptr);
	}

    // ...
}

This solution needs you to create a custom sequence player class and provide a UMediaSoundComponent, or you can just change the implementation of engine’s player, here is an example for custom player:

UCLASS()
class MY_API UMySequencePlayer : public ULevelSequencePlayer
{
	GENERATED_BODY()

public:
	//~begin IMovieScenePlayer interface
	virtual UMediaSoundComponent* GetCustomSoundComponent() const override
    {
    	AMySequenceActor const* SeqActor = Cast<AMySequenceActor>(GetOuter());
        if (!SeqActor)
        {
            return nullptr;
        }
        return SeqActor->GetSoundComponent();
    }
	//~end of IMovieScenePlayer interface
};

UCLASS()
class MY_API AMySequenceActor : public ALevelSequenceActor
{
	GENERATED_BODY()
public:
    // ... (you should init sound component in ctor, leave out here)
	UMediaSoundComponent* GetSoundComponent() const { return SoundComponent; }
private:
	UPROPERTY(BlueprintReadWrite, EditAnywhere, meta = (AllowPrivateAccess = "true"))
	UMediaSoundComponent* SoundComponent{};
};

Then use your custom player to play the sequence, and it should have media playing with sound.