Example #1
0
        public int CreateStream(string pathToFile)
        {
            int stream = proxy.CreateStream(pathToFile, GetDefaultFlags());

            ThrowIfStreamIsInvalid(stream);
            return(stream);
        }
        private int CreateStream(string pathToFile, BASSFlag flags)
        {
            // create streams for re-sampling
            int stream = bassServiceProxy.CreateStream(pathToFile, flags);

            if (stream == 0)
            {
                throw new BassAudioServiceException(bassServiceProxy.GetLastError());
            }

            return(stream);
        }
Example #3
0
        public object PlayFile(string pathToFile)
        {
            int stream = proxy.CreateStream(pathToFile, BASSFlag.BASS_DEFAULT);

            if (stream == 0)
            {
                throw new BassException(proxy.GetLastError());
            }

            if (!proxy.StartPlaying(stream))
            {
                throw new BassException(proxy.GetLastError());
            }

            return(stream);
        }