コード例 #1
0
    public static OneShotSampleStream LoadSampleStream(byte[] streamBytes, int maxSimultaneousPlaybacks)
    {
        int audioStreamHandle = Bass.BASS_SampleLoad(streamBytes, 0, streamBytes.Length, maxSimultaneousPlaybacks, BASSFlag.BASS_DEFAULT);

        var newStream = new OneShotSampleStream(audioStreamHandle, maxSimultaneousPlaybacks);

        liveAudioStreams.Add(newStream);
        return(newStream);
    }
コード例 #2
0
    void LoadSoundClip()
    {
        if (sample != null)
        {
            sample.Dispose();
        }

        sample = editor.sfxAudioStreams.GetSample(SkinKeys.break0);
        Debug.Assert(sample != null);   // todo, get this when entering playing state
        sample.onlyPlayIfStopped = true;
    }
コード例 #3
0
    public static OneShotSampleStream LoadSampleStream(string filepath, int maxSimultaneousPlaybacks)
    {
        UnityEngine.Debug.Assert(System.IO.File.Exists(filepath), "Filepath " + filepath + " does not exist");

        int audioStreamHandle = Bass.BASS_SampleLoad(filepath, 0, 0, maxSimultaneousPlaybacks, BASSFlag.BASS_DEFAULT);

        var newStream = new OneShotSampleStream(audioStreamHandle, maxSimultaneousPlaybacks);

        liveAudioStreams.Add(newStream);
        return(newStream);
    }
コード例 #4
0
    void LoadSoundClip()
    {
        if (sampleStream != null)
        {
            sampleStream.Dispose();
        }

        string customPath = SkinManager.Instance.GetSkinItemFilepath(SkinKeys.metronome);
        string currentSFX = string.IsNullOrEmpty(customPath) ? defaultPath : customPath;

        sampleStream = AudioManager.LoadSampleStream(currentSFX, 15);
    }
コード例 #5
0
    void LoadSoundClip()
    {
        if (sample != null)
        {
            sample.Dispose();
        }

        string customPath = SkinManager.Instance.GetSkinItemFilepath(SkinKeys.break0);
        string currentSFX = string.IsNullOrEmpty(customPath) ? defaultPath : customPath;

        sample = AudioManager.LoadSampleStream(currentSFX, 1);
        sample.onlyPlayIfStopped = true;
    }
コード例 #6
0
    public override void SystemEnter()
    {
        ChartEditor editor = ChartEditor.Instance;

        sampleStream = editor.sfxAudioStreams.GetSample(SkinKeys.metronome);
        Debug.Assert(sampleStream != null);

        float currentAudioTime = editor.services.sfxAudioTime;
        Song  currentSong      = editor.currentSong;

        uint currentTickPos = editor.currentSong.TimeToTick(currentAudioTime, editor.currentSong.resolution);

        if (currentTickPos > 0)
        {
            --currentTickPos;
        }

        nextClapPos = CalculateNextBeatTickPosition(currentTickPos);
    }
コード例 #7
0
    public override void SystemEnter()
    {
        sampleStream = ChartEditor.Instance.sfxAudioStreams.GetSample(SkinKeys.clap);
        Debug.Assert(sampleStream != null && sampleStream.isValid);

        float currentAudioTime = playFromTime;

        ChartEditor editor      = ChartEditor.Instance;
        Song        currentSong = editor.currentSong;

        uint currentTick = currentSong.TimeToTick(currentAudioTime, currentSong.resolution);

        noteTracker       = new SongObjectTracker <Note>(ChartEditor.Instance.currentChart.notes, currentTick);
        spTracker         = new SongObjectTracker <Starpower>(ChartEditor.Instance.currentChart.starPower, currentTick);
        chartEventTracker = new SongObjectTracker <ChartEvent>(ChartEditor.Instance.currentChart.events, currentTick);
        bpmTracker        = new SongObjectTracker <BPM>(ChartEditor.Instance.currentSong.bpms, currentTick);
        tsTracker         = new SongObjectTracker <TimeSignature>(ChartEditor.Instance.currentSong.timeSignatures, currentTick);
        sectionTracker    = new SongObjectTracker <Section>(ChartEditor.Instance.currentSong.sections, currentTick);
        eventsTracker     = new SongObjectTracker <Event>(ChartEditor.Instance.currentSong.events, currentTick);
    }
コード例 #8
0
 public override void SystemExit()
 {
     sampleStream = null;
 }
コード例 #9
0
 public override void SystemExit()
 {
     missSoundSample = null;
     ChartEditor.Instance.uiServices.SetGameplayUIActive(false);
 }
コード例 #10
0
 void LoadSoundClip()
 {
     missSoundSample = ChartEditor.Instance.sfxAudioStreams.GetSample(SkinKeys.break0);
     Debug.Assert(missSoundSample != null);
     missSoundSample.onlyPlayIfStopped = true;
 }
コード例 #11
0
 public StreamConfig(string defaultPath)
 {
     this.defaultPath = defaultPath;
     stream           = null;
 }
コード例 #12
0
 public override void SystemExit()
 {
     missSoundSample         = null;
     hitWindowFeeder.enabled = false;
     ChartEditor.Instance.uiServices.SetGameplayUIActive(false);
 }