예제 #1
0
        internal Music(AudioManager audioManager, [NotNull] WaveStream waveStream, float volume, bool externalWaveStream)
        {
            _audioManager         = audioManager;
            _baseWaveStream       = waveStream;
            _isExternalWaveStream = externalWaveStream;

            if (AudioHelper.NeedsFormatConversionFrom(waveStream.WaveFormat, RequiredFormat))
            {
                _formatConvertedStream = new ResamplerDmoStream(waveStream, RequiredFormat);
            }
            else
            {
                _formatConvertedStream = waveStream;
            }

            OffsetStream = new WaveOffsetStream(_formatConvertedStream);

            IsStopped = true;

            CachedVolume = volume;
        }