Ejemplo n.º 1
0
        internal Song(string fileName)
        {
            Vorbisfile.ov_fopen(fileName, out vorbisFile);
            Vorbisfile.vorbis_info fileInfo = Vorbisfile.ov_info(
                vorbisFile,
                0
                );

            // Thanks sizeof(long) -flibit
            int fileRate = (int)(fileInfo.rate.ToInt64() & 0xFFFFFFFF);

            // TODO: ov_comment() -flibit
            Name        = Path.GetFileNameWithoutExtension(fileName);
            TrackNumber = 0;

            Duration = TimeSpan.FromSeconds(
                Vorbisfile.ov_time_total(vorbisFile, 0)
                );

            soundStream = new DynamicSoundEffectInstance(
                fileRate,
                (AudioChannels)fileInfo.channels
                );
            // FIXME: I need this to bypass XNA's gain clamp... -flibit
            soundStream.INTERNAL_isXACTSource = true;

            // FIXME: 60 is arbitrary for a 60Hz game -flibit
            chunkSize = (int)(fileRate * fileInfo.channels / 60);
            chunkStep = chunkSize / VisualizationData.Size;

            IsDisposed = false;
        }
Ejemplo n.º 2
0
        internal Song(string fileName)
        {
            Vorbisfile.ov_fopen(fileName, out vorbisFile);
            Vorbisfile.vorbis_info fileInfo = Vorbisfile.ov_info(
                vorbisFile,
                0
                );

            // TODO: ov_comment() -flibit
            Name        = Path.GetFileNameWithoutExtension(fileName);
            TrackNumber = 0;

            Duration = TimeSpan.FromSeconds(
                Vorbisfile.ov_time_total(vorbisFile, 0)
                );

            soundStream = new DynamicSoundEffectInstance(
                (int)fileInfo.rate,
                (AudioChannels)fileInfo.channels
                );

            // FIXME: 60 is arbitrary for a 60Hz game -flibit
            chunkSize = (int)(fileInfo.rate * fileInfo.channels / 60);
            chunkStep = chunkSize / VisualizationData.Size;

            IsDisposed = false;
        }
Ejemplo n.º 3
0
        internal Song(string fileName)
        {
            Vorbisfile.ov_fopen(fileName, out vorbisFile);
            Vorbisfile.vorbis_info fileInfo = Vorbisfile.ov_info(
                vorbisFile,
                0
                );

            // TODO: ov_comment() -flibit
            Name        = Path.GetFileNameWithoutExtension(fileName);
            TrackNumber = 0;

            Duration = TimeSpan.FromSeconds(
                Vorbisfile.ov_time_total(vorbisFile, 0)
                );

            soundStream = new DynamicSoundEffectInstance(
                (int)fileInfo.rate,
                (AudioChannels)fileInfo.channels
                );

            IsDisposed = false;
        }