Playing mpeg radio station on PS4

,

Hi,
I’m tyring to play a radio stream on PS4, but I’m getting a FMOD_ERR_FORMAT error from system->playSound(…).

The stream is mpeg.

Is there something I need to enable on PS4 to get this to work?

Here’s the url: yp.shoutcast.com/sbin/tunein-station.pls?id=99497996

Any ideas?

Hi,

Thanks for sharing the link. Testing it in our examples: fmodstudioapi20225ps4_sdk11.500-installer_147358\api\core\examples\vs2019\examples.slnnet_stream
I was able to hear the stream on our test machine.

Could I please grab some more info:

  • FMOD Studio and integration versions
  • Unreal Engine version exactly

Thanks for testing.

I’m on Unreal 4.27 and FMOD studio api 2019 ps4 sdk 10.500

1 Like

Thank you for the information.

Just to confirm the FMOD version, was it 2.02.19? As we don’t have SDK 10.500 available on our download page.

It can be confirmed in UE by checking the about FMOD under the Help toolbar:


.

Ah, thanks. I’m on 2.02.19

Thanks for confirming that. Can you confirm where you downlaoded the integration from for SDK 10.500? I cannot find it on our downlaod page:


Thanks

Ah, so I’m not sure now. I have FMOD Engine for PlayStation 4 (SDK 10.500) - See screen shot. But I’m not sure I used that.

I also have fmodstudio20219ue4.27ps4_sdk9.000.zip (See bottom of screen shot)

So I could be on SDK 9.000. Does that sound right?

Hi, that does sound right. Thank you for confirming that.

Would it be possible to share the code you are using to play the stream in your Unreal project?

Sure, here is my code. I’ve squished it into 1 function and checked it still comes up with the same error:

void Caudio::init()
{
	// init core api

	FMOD_RESULT result;
	result = FMOD::System_Create(&system);      // Create the main system object.
	if (result != FMOD_OK)
	{
		showError("System_Create", result);
		return;
	}

	// Set the DSP buffer size to 1024 samples
	unsigned int bufferLength = 1024; // Number of samples per DSP processing callback
	int numBuffers = 4; // Number of buffers (default is usually 4)
	result = system->setDSPBufferSize(bufferLength, numBuffers);
	if (result != FMOD_OK)
	{
		showError("setDSPBufferSize", result);
		return;
	}

	result = system->init(512, FMOD_INIT_NORMAL, 0);    // Initialize FMOD.
	if (result != FMOD_OK)
	{
		showError("system->init", result);
		return;
	}

	// Create music group
	system->createChannelGroup("BHMusic", &musicChannelGroup);

	// Test play radio station
	result = system->createStream("http://yp.shoutcast.com/sbin/tunein-station.pls?id=99497996", FMOD_DEFAULT, NULL, &musicSound);
	if (result != FMOD_OK)
	{
		showError("playMusicW HTTP", result);
		return;
	}

	result = system->playSound(musicSound, musicChannelGroup, false, &musicChannel);
	if (result != FMOD_OK)
	{
		showError("playMusicW - PlaySound", result);
		return;
	}
}

Thank you for the code.

Could you please try updating the createStream() function with the following

memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));
exinfo.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.filebuffersize = 1024 * 16;        /* Increase the default file chunk size to handle seeking inside large playlist files that may be over 2kb. */
// Test play radio station
result = system->createStream("http://yp.shoutcast.com/sbin/tunein-station.pls?id=99497996", FMOD_CREATESTREAM | FMOD_NONBLOCKING, &exinfo, &musicSound);
if (result != FMOD_OK)
{
    showError("playMusicW HTTP", result);
    return;
}

Two issues I identified was missing the exinfo (FMOD Engine | Core API Reference - FMOD_CREATESOUNDEXINFO) which contains information about the sound to be played and updating the flags used when creating the sound (FMOD Engine | Core API Reference - FMOD_MODE).

Let me know if that works.