Plays a track at the given position.
165689
def play_track(self, track_id=DEFAULT_TRACK_ID, position=0):
        """"""
        self.publish(
            action='playTrack',
            resource='audioPlayback/player',
            publish_response=False,
            properties={'trackId': track_id, 'position': position}
        )
821449
def _on_song_changed(self, song):
        
        logger.debug('Player received song changed signal')
        if song is not None:
            logger.info('Try to play song: %s' % song)
            if song.url:
                self.play(song.url)
            else:
                self._playlist.mark_as_bad(song)
                self.play_next()
        else:
            self.stop()
            logger.info('No good song in player playlist anymore.')
1074766
def play_Bar(self, bar):
        """"""
        self.set_deltatime(self.delay)
        self.delay = 0
        self.set_meter(bar.meter)
        self.set_deltatime(0)
        self.set_key(bar.key)
        for x in bar:
            tick = int(round((1.0 / x[1]) * 288))
            if x[2] is None or len(x[2]) == 0:
                self.delay += tick
            else:
                self.set_deltatime(self.delay)
                self.delay = 0
                if hasattr(x[2], 'bpm'):
                    self.set_deltatime(0)
                    self.set_tempo(x[2].bpm)
                self.play_NoteContainer(x[2])
                self.set_deltatime(self.int_to_varbyte(tick))
                self.stop_NoteContainer(x[2])
1136074
function playgroundPlay() {
  var reelId = $('#playReelId').val();

  var loopCount = parseInt($('#playRepeatCount').val());
  if (isNaN(loopCount)) loopCount = 1;

  spriteAnimation.animate(reelId, loopCount);
}
967547
public boolean play (SoundType type, String pkgPath, String key, int delay)
    {
        return play(type, pkgPath, key, delay, PAN_CENTER);
    }
148445
public void addTrack(SoundCloudTrack track, boolean playNow) {
        checkState();
        mPlayerPlaylist.add(track);
        for (CheerleaderPlaylistListener listener : mCheerleaderPlaylistListeners) {
            listener.onTrackAdded(track);
        }
        if (playNow) {
            play(mPlayerPlaylist.size() - 1);
        }
    }
974623
def play_async(cls, file_path, on_done=None):
        
        thread = threading.Thread(
            target=AudioPlayer.play, args=(file_path, on_done,))
        thread.start()
1072816
async def play(self, ctx, *, query):
        """"""

        source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(query))
        ctx.voice_client.play(source, after=lambda e: print('Player error: %s' % e) if e else None)

        await ctx.send('Now playing: {}'.format(query))
1091108
def play(score)
      score.map{|note|[note, note.to_s.freeze]}.each do |note, packet|
        case note
        when RestNote
          sleep Rational(60.to_f, score.tempo) * Rational(note.length.to_f, Note4)
        when Note
          @io << packet
          @io.flush
          sleep Rational(60.to_f, score.tempo) * Rational(note.length.to_f, Note4)
          stop 0, note.key
          @io.flush
        end
      end
    end
887916
def main(source_samplerate, target_samplerate, params, converter_type):
    """"""
    from time import sleep

    ratio = target_samplerate / source_samplerate

    with sr.CallbackResampler(get_input_callback(source_samplerate, params),
                              ratio, converter_type) as resampler, \
            sd.OutputStream(channels=1, samplerate=target_samplerate,
                            callback=get_playback_callback(
                                resampler, target_samplerate, params)):
        print("Playing back...  Ctrl+C to stop.")
        try:
            while True:
                sleep(1)
        except KeyboardInterrupt:
            print("Aborting.")
1132443
public void play(SoundCloudTrack track) {
        checkState();
        ArrayList<SoundCloudTrack> tracks = mPlayerPlaylist.getPlaylist().getTracks();
        int position = tracks.indexOf(track);
        if (position > -1) {
            mPlayerPlaylist.setPlayingTrack(position);
            PlaybackService.play(getContext(), mClientKey, track);
        }
    }
143125
public void next() {
        final PlayList pl = getPlaylist();

        final int previousPosition = pl.getCurrentSlide();
        pl.next();
        final int currentPosition = pl.getCurrentSlide();

        playSlide(currentPosition, previousPosition);
    }
1260045
function Player(eventHandlers) {
    var self = this, loading = null;
    this.label = 'Bandcamp';
    this.eventHandlers = eventHandlers || {};
    this.currentTrack = {position: 0, duration: 0};
    this.sound = null;
    this.isReady = false;
    loading = setInterval(function(){
      if (!!window["soundManager"]) {
        clearInterval(loading);
        self.isReady = true;
        self.clientCall("onApiReady", self);
      }
    }, 200);
  }
588653
void processBeat(Beat beat) {
        if (isRunning() && beat.isTempoMaster()) {
            setMasterTempo(beat.getEffectiveTempo());
            deliverBeatAnnouncement(beat);
        }
    }
1036203
function onAdvance(event, globalObject) {
    var maxPlayHistoryLength = globalObject.config.DubBotBase.numberOfPlayedSongsToStore;

    // Add the new song to the song history
    var play = {
        media: event.media,
        startDate: event.startDate,
        user: event.incomingDJ,
        votes: {
            grabs: [],
            mehs: [],
            woots: []
        }
    };

    globalObject.roomState.playHistory.unshift(play);

    if (globalObject.roomState.playHistory.length > maxPlayHistoryLength) {
        globalObject.roomState.playHistory.length = maxPlayHistoryLength;
    }
}
198891
void setPlayingTrack(int playingTrackPosition) {
        if (playingTrackPosition < 0 || playingTrackPosition >= mSoundCloudPlaylist.getTracks().size()) {
            throw new IllegalArgumentException("No tracks a the position " + playingTrackPosition);
        }
        mCurrentTrackIndex = playingTrackPosition;
    }
572761
def play(self, stream_url, offset=0, opaque_token=None):
        """"""

        self._response['shouldEndSession'] = True
        directive = self._play_directive('REPLACE_ALL')
        directive['audioItem'] = self._audio_item(stream_url=stream_url, offset=offset, opaque_token=opaque_token)
        self._response['directives'].append(directive)
        return self