how to open an mp3 file and play it on the next scene?

ok, so i need to open an mp3 file, i tried WWW and searched google, but havn’t found the answer. www does not support mp3 on computers, ok, so i make a game kinda like audio surf but diffrent, i got everything working except the song selection. i need to enter a path in a textfield, click a button, and it should load the song into a gameobject with DontDestroyOnLoad (), and play it. Thanks for helping.

You can do that easily using Audio Source and Audio listener, Add an audio to an empty game object or existing one, there in the inspector of Audio source you will be asked for a audio source file, just drag and drop the audio.

But to import audio, goto Assets-> Import New Assets and select the file you want, it will get added to your project.

You can have this one as a script reference…

while (true) {
 if (controller.isGrounded && controller.velocity.magnitude > 0.3) {
 audio.clip = walkSounds[Random.Range(0, walkSounds.length)];
 audio.Play();
 yield WaitForSeconds(audioStepLength);
 } else {
 yield;
 }
 }

And refer this link, it has much more…
Audio Clip Answers

Have a look on the script reference for Audio Source, Script Reference