What's wrong with my audiostream on android?
I have made simple program which streams mp3 files at runtime. It works well on Windows system, I can open all mp3 files by using WWW class and play song from it. The problem occures when I trying to use application on my phone or even Android emulator. Application won't work on Android by stopping all code on one weird step which works on Windows.
private IWavePlayer m_Wave_Out_Device;
private WaveStream m_Main_Output_Stream;
private WaveChannel32 m_Volume_Stream;
private bool Load_Audio_From_Data(byte[] data){
try{
// 1
MemoryStream tmp_str = new MemoryStream(data);
// 2
m_Main_Output_Stream = new Mp3FileReader(tmp_str);
// 3
m_Volume_Stream = new WaveChannel32(m_Main_Output_Stream);
// 4
m_Wave_Out_Device = new WaveOut();
// 5
m_Wave_Out_Device.Init(m_Volume_Stream);
// 6
return true;
}
catch(System.Exception ex){
// 7
Debug.LogWarning ("Error! " + ex.Message);
}
// 8
return false;
}
The code between "2" and "3" step seems to make problem becouse from it application jumps to "7" and "8". Like I said on Windows it works well, so I have got 2 questions.
Did I set wrong path to file? I have tried every combination. Now it looks like this.
WWW www = new WWW ("file:///storage/emulated/0/Download/Rep.mp3");
If everything is good, why code won't work? Any suggestions?
Comment