Plays the audio. This method plays the audio, and shouldn't be called
    explicitly, let the constructor do so.
514481
def run(self):
    
    # From now on, it's multi-thread. Let the force be with them.
    st = self.stream._stream

    for chunk in chunks(self.audio,
                        size=self.chunk_size*self.nchannels,
                        dfmt=self.dfmt):
      #Below is a faster way to call:
      #  self.stream.write(chunk, self.chunk_size)
      self.write_stream(st, chunk, self.chunk_size, False)
      if not self.go.is_set():
        self.stream.stop_stream()
        if self.halting:
          break
        self.go.wait()
        self.stream.start_stream()

    # Finished playing! Destructor-like step: let's close the thread
    with self.lock:
      if self in self.device_manager._threads: # If not already closed
        self.stream.close()
        self.device_manager.thread_finished(self)
220248
private static Playback createPlayback(Media media, Align alignment, int volume) throws IOException
    {
        final AudioInputStream input = openStream(media);
        final SourceDataLine dataLine = getDataLine(input);
        dataLine.start();
        updateAlignment(dataLine, alignment);
        updateVolume(dataLine, volume);

        return new Playback(input, dataLine);
    }
1269250
@Override
  public void play(SpeechAnnouncement announcement) {
    boolean isInvalidAnnouncement = announcement == null;
    if (isInvalidAnnouncement) {
      return;
    }
    this.announcement = announcement;
    playAnnouncementTextAndTypeFrom(announcement);
  }
1168734
function(o) {
      var self = this;

      // If we don't have an AudioContext created yet, run the setup.
      if (!Howler.ctx) {
        setupAudioContext();
      }

      // Setup user-defined default properties.
      self._autoplay = o.autoplay || false;
      self._format = (typeof o.format !== 'string') ? o.format : [o.format];
      self._html5 = o.html5 || false;
      self._muted = o.mute || false;
      self._loop = o.loop || false;
      self._pool = o.pool || 5;
      self._preload = (typeof o.preload === 'boolean') ? o.preload : true;
      self._rate = o.rate || 1;
      self._sprite = o.sprite || {};
      self._src = (typeof o.src !== 'string') ? o.src : [o.src];
      self._volume = o.volume !== undefined ? o.volume : 1;
      self._xhrWithCredentials = o.xhrWithCredentials || false;

      // Setup all other default properties.
      self._duration = 0;
      self._state = 'unloaded';
      self._sounds = [];
      self._endTimers = {};
      self._queue = [];
      self._playLock = false;

      // Setup event listeners.
      self._onend = o.onend ? [{fn: o.onend}] : [];
      self._onfade = o.onfade ? [{fn: o.onfade}] : [];
      self._onload = o.onload ? [{fn: o.onload}] : [];
      self._onloaderror = o.onloaderror ? [{fn: o.onloaderror}] : [];
      self._onplayerror = o.onplayerror ? [{fn: o.onplayerror}] : [];
      self._onpause = o.onpause ? [{fn: o.onpause}] : [];
      self._onplay = o.onplay ? [{fn: o.onplay}] : [];
      self._onstop = o.onstop ? [{fn: o.onstop}] : [];
      self._onmute = o.onmute ? [{fn: o.onmute}] : [];
      self._onvolume = o.onvolume ? [{fn: o.onvolume}] : [];
      self._onrate = o.onrate ? [{fn: o.onrate}] : [];
      self._onseek = o.onseek ? [{fn: o.onseek}] : [];
      self._onunlock = o.onunlock ? [{fn: o.onunlock}] : [];
      self._onresume = [];

      // Web Audio or HTML5 Audio?
      self._webAudio = Howler.usingWebAudio && !self._html5;

      // Automatically try to enable audio.
      if (typeof Howler.ctx !== 'undefined' && Howler.ctx && Howler.autoUnlock) {
        Howler._unlockAudio();
      }

      // Keep track of this Howl group in the global controller.
      Howler._howls.push(self);

      // If they selected autoplay, add a play event to the load queue.
      if (self._autoplay) {
        self._queue.push({
          event: 'play',
          action: function() {
            self.play();
          }
        });
      }

      // Load the source file unless otherwise specified.
      if (self._preload) {
        self.load();
      }

      return self;
    }
995857
def run(self):
		
		if not hasattr(self, 'queue'):
			raise RuntimeError("Audio queue is not intialized.")

		chunk = None
		channel = None
		self.keep_listening = True
		while self.keep_listening:
			if chunk is None:
				try:
					frame = self.queue.get(timeout=queue_timeout)
					chunk = pygame.sndarray.make_sound(frame)
				except Empty:
					continue

			if channel is None:
				channel = chunk.play()
			else:
				if not channel.get_queue():	
					channel.queue(chunk)
					chunk = None
			time.sleep(0.005)
		
		if not channel is None and pygame.mixer.get_init():
			channel.stop()
			pygame.mixer.quit()
1343489
private void initStreams() throws IOException {
		if (audio != null) {
			audio.close();
		}
		
		OggInputStream audio;
		
		if (url != null) {
			audio = new OggInputStream(url.openStream());
		} else {
			audio = new OggInputStream(ResourceLoader.getResourceAsStream(ref));
		}
		
		this.audio = audio;
		positionOffset = 0;
	}
968670
private void doStartPlaying()
	{
		if (currentContainer!=null)
		{
			doStopPlaying();
			if (currentContainer instanceof ModContainer)
			{
				System.out.println(((ModContainer) currentContainer).getCurrentMod().toString());
			}
			Mixer mixer = createNewMixer();
			mixer.setExportFile(wavFileName);
			playerThread = new PlayThread(mixer, this);
			playerThread.start();
		}
	}
974623
def play_async(cls, file_path, on_done=None):
        
        thread = threading.Thread(
            target=AudioPlayer.play, args=(file_path, on_done,))
        thread.start()
1260706
function() {
    var self = this;
    var keys = Object.keys(self._spriteMap);

    keys.forEach(function(key) {
      window[key].addEventListener('click', function() {
        self.play(key);
      }, false);
    });
  }
315508
private void setupAudio() {
		audio.setAutoplay(cbAutoPlay.isSelected());
		audio.setLoop(!cbLoop.isDisabled() && cbLoop.isSelected());
		audio.setControls(cbControls.isSelected() ? WAudio.Controls.PLAY_PAUSE : WAudio.Controls.NATIVE);
		audio.setDisabled(cbControls.isSelected() && cbDisable.isSelected());
	}
2817
function onAudioLoad(e) {
    if (audio.soundSource === undefined) {
    // create a sound source
      audio.soundSource = audio.context.createMediaElementSource(audio.element);
    } else {
      audio.soundSource.disconnect();
    }

    // Connectors
    audio.soundSource.connect(audio.analyser);
    audio.soundSource.connect(audio.splitter);

    // Sound is loaded and ready to start playing
    audio.loaded = true;
  }
634285
function() {
          self._playLock = false;
          setParams();
          self._refreshBuffer(sound);

          // Setup the playback params.
          var vol = (sound._muted || self._muted) ? 0 : sound._volume;
          node.gain.setValueAtTime(vol, Howler.ctx.currentTime);
          sound._playStart = Howler.ctx.currentTime;

          // Play the sound using the supported method.
          if (typeof node.bufferSource.start === 'undefined') {
            sound._loop ? node.bufferSource.noteGrainOn(0, seek, 86400) : node.bufferSource.noteGrainOn(0, seek, duration);
          } else {
            sound._loop ? node.bufferSource.start(0, seek, 86400) : node.bufferSource.start(0, seek, duration);
          }

          // Start a new timer if none is present.
          if (timeout !== Infinity) {
            self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);
          }

          if (!internal) {
            setTimeout(function() {
              self._emit('play', sound._id);
              self._loadQueue();
            }, 0);
          }
        }
386030
public static void play(Context context, String clientId, SoundCloudTrack track) {
        Intent intent = new Intent(context, PlaybackService.class);
        intent.setAction(ACTION_PLAY);
        intent.putExtra(BUNDLE_KEY_SOUND_CLOUD_CLIENT_ID, clientId);
        intent.putExtra(BUNDLE_KEY_SOUND_CLOUD_TRACK, track);
        context.startService(intent);
    }
8649
public void play(Module module, int source, boolean loop, boolean start) {
		this.source = source;
		this.loop = loop;
		this.module = module;
		done = false;
		
		ibxm = new IBXM(48000);
		ibxm.set_module(module);
		songDuration = ibxm.calculate_song_duration();

		if (bufferNames != null) {
			AL10.alSourceStop(source);
			bufferNames.flip();
			AL10.alDeleteBuffers(bufferNames);
		}
		
		bufferNames = BufferUtils.createIntBuffer(2);
		AL10.alGenBuffers(bufferNames);
		remainingBufferCount = 2;
		
		for (int i=0;i<2;i++) {
	        stream(bufferNames.get(i));
		}
        AL10.alSourceQueueBuffers(source, bufferNames);
		AL10.alSourcef(source, AL10.AL_PITCH, 1.0f);
		AL10.alSourcef(source, AL10.AL_GAIN, 1.0f); 
		
		if (start) {
			AL10.alSourcePlay(source);
		}
	}
470667
def play(self):
        
        msg = cr.Message()
        msg.type = cr.PLAY
        self.send_message(msg)
1012842
def play(self):
        """"""
        self._response['shouldEndSession'] = True
        self._response['action']['audio']['interface'] = 'play'
        self._response['action']['audio']['sources'] = []
        return self
858940
function play(name) {
        if (name === 'list') {
            return Object.keys(audio);
        }
        if (!(name in audio)) {
            d.error("Invalid audio name:", name);
            return;
        }

        audio[name].play();
    }