protected override void ButtonPush() { AudioManager.GetInstance().PlaySoundAtPosition(buttonClickSound, transform); PlayEvent?.Invoke(); ClearRemaingObjects(); SetPlayState(true); }
/// <summary> /// Playing the audio (Check if initialized & paused) /// </summary> /// <param name="file"></param> /// <param name="volume"></param> public void Play(string file, int volume) { PlayEvent?.Invoke(null, file); if (Bass.BASS_ChannelIsActive(Stream) != BASSActive.BASS_ACTIVE_PAUSED) { Stop(); //Stopping existing stream if (InitBass(HZ)) { Stream = Bass.BASS_StreamCreateFile(file, 0, 0, BASSFlag.BASS_DEFAULT); //Loading in audio file into stream if (Stream != 0) { Volume = volume; Bass.BASS_ChannelSetAttribute(Stream, BASSAttribute.BASS_ATTRIB_VOL, Volume / 100F); //Initializing channel volume attribute Bass.BASS_ChannelPlay(Stream, false); //Start playing the stream } } } else { Bass.BASS_ChannelPlay(Stream, false); } EqEnable(_eqEnabled); // Enabling EQ based on _eqEnabled state activeState = PlayerState.Playing; }
/// <summary> /// Play at specified time. /// </summary> public void Play(float time = -1) { //if( _sequencers == null ){ if (_multiSequencer == null) { Debug.LogWarning("Can't play, you need to load a file first.\n"); return; } if (time != -1) { _time = time; } // Fire note off messages. for (int ch = 0; ch < 16; ch++) { for (int k = 0; k < 128; k++) { if (_onMemo[ch, k]) { _onNoteOffEvent.Invoke(ch, (byte)k); _onMemo[ch, k] = false; } } } _isPlaying = true; List <MidiEvent> events = _multiSequencer.Start(_time); if (_time == 0) { DispatchEvents(events); } _onPlayEvent.Invoke(); }
public void ActionPlay() { PlayEvent?.Invoke(); }
public void RaisePlayEvent(object sender, System.Windows.RoutedEventArgs e) { // Your logic PlayEvent?.Invoke(); }
public void OnClick(bool onoff) { Debug.Log("startTime = " + startTime + " endTime = " + endTime); OnPlayClick.Invoke(startTime, endTime); }
protected virtual void OnPlayEvent(PlayEventArgs e) => PlayEvent?.Invoke(this, e);
private void play_mi_Click(object sender, RoutedEventArgs e) { PlayEvent?.Invoke(null, null); }
private void Button2_Click(object sender, EventArgs e) { PlayEvent?.Invoke(this, EventArgs.Empty); updateButtons(); }
public void Play() { PlayEvent?.Invoke(); }
public void ActionPlay() { PlayEvent?.Invoke(); gameObject.SetActive(false); }