internal SoundEffect(string fileName) { _filename = fileName; if (_filename == string.Empty) { throw new FileNotFoundException("Supported Sound Effect formats are wav, mp3, acc, aiff"); } int size; ALFormat format; double rate; double duration; _data = OpenALSupport.LoadFromFile(_filename, out size, out format, out rate, out duration); _name = Path.GetFileNameWithoutExtension(fileName); Rate = (float)rate; Size = size; Format = format; _duration = TimeSpan.FromSeconds(duration); //Console.WriteLine ("From File: " + _name + " - " + Format + " = " + Rate + " / " + Size + " -- " + Duration); }
public static byte[] LoadFromFile(string filename, out int dataBufferSize, out ALFormat alFormat, out double sampleRate, out double duration) { return(OpenALSupport.GetOpenALAudioDataAll(NSUrl.FromFilename(filename), out dataBufferSize, out alFormat, out sampleRate, out duration)); }