Hi! I intended to use directx to play some .mp3 files outside of compiled game. Like this:
using UnityEngine;
using System.Collections;
using Microsoft.DirectX.AudioVideoPlayback;
public class LegendasVozes : MonoBehaviour
{
Audio Teste = new Audio("Arquivo/Vozes/0001.mp3");
void Start ()
{
Teste.play();
}
}
But this error appear on the unity console:
Assets/LegendasVozes.cs(5,17): error CS0234: The type or namespace name `DirectX' does not exist in the namespace `Microsoft'. Are you missing an assembly reference?
AudioClip Voz = new AudioClip();
WWW teste = new WWW("file://C:/Users/Vinícius/Documents/GUI's Test/Arquivos/Vozes/0001.mp3");
Voz = teste.audioClip;
audio.clip = Voz;
audio.Play();
Nothing happens, not even an error!
PS: I already test using a .ogg file instead of .mp3 and using this path:
WWW teste = new WWW("file://Arquivos/Vozes/0001.mp3");
“Grande Eric”! PS: It is a great greeting in Portuguese of Brazil. XD
Mate, I have tried this:
WWW teste = new WWW("file://C:/Users/Vinícius/Documents/GUI's Test/Arquivos/Vozes/0001.ogg");
Voz = teste.oggVorbis;
audio.clip = Voz;
audio.Play();
But this error appear:
begin<end
UnityEngine.WWW:get_oggVorbis()
LegendasVozes:Legenda(Int32) (at Assets/LegendasVozes.cs:45) // the .oggVorbis line
LegendasVozes:Start() (at Assets/LegendasVozes.cs:64) // It is the call of the method where all this should all works.