Prime31 Media Player Plugin

I am using Prime31’s Media player plugin.

So far I have a button that brings up the media pick list. It starts playing the songs i choose after it closes the window but as soon as I touch any other control/object in my game the audio stops. That includes the music that was playing and any other game audio. If I go back to the iOS desktop (iOS 4.x) and then reenter my game, the game audio is back again.

Anyone else using the plugin successfully?

iByte

That sounds weird,

Are any of your audio sources compressed or mp3?
That might conflict with the iPod music you are playing and cause it to stop. Does it fade out to silence or just cut off?

Hi Petey, the iPod music fades away as soon as I touch something on the screen be it a 3d object or EZ-GUI control. My game Audio sources are ogg-vorbis which I assume are getting converted to a iDevice compatible format under the covers.

Audio works fine if I don’t invoke the media player. If I do invoke the media player the music plays fine until i touch the screen. from there the only way i know to get it going again is to switch to the iOS desktop and then select the game again, at which point game audio is restored.

Switch them to native(WAV) in unity and try that.
As far as i know, the ogg-vorbis files will stay in a compressed format when build to the device and compressed stuff doesn’t play nice with iPod music. I think it’s because the device can only play one compressed audio file at a time.
Usually you only use compressed audio for background music(if you have it) and then uncompressed for all effects etc.

Hmm … I was loading my audio files via the www class and that only supports ogg-vorbis …

Oh no, I reckon that is where the problem is coming from.

What about this one - Unity - Scripting API: WWW.audioClip
Problem is, it may take a while to download with the files being uncompressed.

Hi Petey,

no I don’t think that is the problem. I switched to www download only to give my Audio engineer a way to update sounds on the fly so that he can try different things without me having to do a new build every time. The code is setup up so that if files are found in the documents directory it will try to download them and replace the built in audio. No files found then it reverts to built in audio.

I think it’s possible you might be onto to something when you said you can’t play compressed audio and built in music at the sametime …

Perhaps if I let a player select music then I need to turn off the built in audio until they stop playing the music at which time i can turn built in audio back on.

iByte

So … anyone using this plugin???

You can’t have 2 compressed audio sources at the same time. As long as the media player is playing music you can’t play any other music ingame

Eskema,

thanks then I will go and convert my in game Audio to uncompressed. Was using compressed in order to load audioclips over www

is media player recognized as an audio source in the unity project?