x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Correct way to play mediaplayer audio in 4.18?

So in 4.17 I was using audio with mediaplayer like so:

 Constructor:
 MediaPlayer = ConstructObject<UMediaPlayer>(UMediaPlayer::StaticClass());
 NewMediaSoundWave = ConstructObject<UMediaSoundWave>(UMediaSoundWave::StaticClass());
 ...
 MediaPlayer->SetSoundWave(NewMediaSoundWave);
 UWorld* const World = GetWorld();
 UGameplayStatics::PlaySoundAtLocation(World,NewMediaSoundWave, FVector(0, 0, 0));

In 4.18 Runtime/MediaAssets/Public/MediaSoundWave.h doesn't exist anymore. How should I be coding something similar after the update?

Also is there anywhere but release notes I can get more in depth info on what has changed with regards to code in the update?

Product Version: UE 4.18
Tags:
more ▼

asked Oct 25 '17 at 06:41 PM in C++ Programming

avatar image

Mctittles
66 4 10 14

avatar image Mctittles Oct 26 '17 at 12:03 AM

As an update I've tried creating an actor and adding the mediasoundcomponent, however I get errors when attempting to include "Runtime/MediaAssets/Public/MediaSoundComponent.h"

avatar image Mctittles Oct 26 '17 at 01:24 AM

Error is from MediaSampleQueue.h and is: '_InterlockedIncrement': is not a member of 'FWindowsPlatformAtomics' 50

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Ok I think I figured out my issue. First you do need to create an AActor, place it in the level, and add the MediaSoundComponent. With this I was getting errors trying to include MediaSoundComponent.h however I found it was only in one file.

Tracked down the error to when I include windows.h/stdio.h which I was using to get drive paths. I'll now have to find out how to do that.

more ▼

answered Oct 26 '17 at 05:05 PM

avatar image

Mctittles
66 4 10 14

avatar image Mctittles Oct 26 '17 at 05:09 PM

Fixed the issue with windows.h. Works as long as it's not included before MediaSoundComponent.h

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Is it still possible to create an Audio sound asset from MediaPlayer in 4.18?

more ▼

answered Nov 11 '17 at 12:40 AM

avatar image

codeslicer0
41 1 4 6

avatar image codeslicer0 Nov 11 '17 at 01:43 AM

I figured it out - we now need to add a MediaSound component to an Actor in the level (just like described above in C++)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question